谁能帮我注译下下面的程序!

woshimoccc 2008-07-09 07:35:23
function myprivacy()
{
var Oform = document.getElementById('Form5');
var photo_show = 1;
if(document.getElementById('show_1').checked)
{
var photo_show = 1;
}
if(document.getElementById('show_2').checked)
{
var photo_show = 2;
}
if(document.getElementById('show_3').checked)
{
var photo_show = 3;
}
if(document.getElementById('show_4').checked)
{
var photo_show = 4;
}
if(document.getElementById('show_5').checked)
{
var photo_show = 5;
}
var show_pwd = document.getElementById('show_pwd').value;
document.getElementById('run_fra').src="/register/privacy.php?photo_show="+photo_show+"&show_pwd="+show_pwd;
}


var div_move = 0;
var IE = document.all?true:false;
var tempX,tempY,oldX,oldY;
var have_move = 0;
function grasp()
{
div_move = 1;
if(IE)
{
document.getElementById("source_div").setCapture();
}
}

function free()
{
div_move = 0;
have_move = 0;
if(IE)
{
document.getElementById("source_div").releaseCapture();
}
}

function getMouseXY(e)
{
if (IE)
{ // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
}
else
{
// grab the x-y pos.s if browser is NS
tempX = e.pageX
tempY = e.pageY
}
// catch possible negative values in NS4
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
}

function move_it(e)
{
getMouseXY(e);
if(div_move == 1)
{
if(have_move == 0)
{
//alert('a');
oldX = tempX;
oldY = tempY;
have_move = 1;
}
var left = parseInt(document.getElementById("source_div").style.left);
var top = parseInt(document.getElementById("source_div").style.top);
//alert(top);
//alert(left);
//alert(tempX);
//alert(oldX);

document.getElementById("source_div").style.left = (left + tempX - oldX) + 'px';
document.getElementById("source_div").style.top = (top + tempY - oldY) + 'px';
oldX = tempX;
oldY = tempY;
}
}

function change_size(method)
{
if(method == 1)
{
var per = 1.25;
}
else
{
var per = 0.8;
}
document.getElementById("show_img").width = document.getElementById("show_img").width*per;
//document.getElementById("show_img").height = document.getElementById("show_img").height*per;
}

function load_move()
{
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left + 150;
}

function micro_move(method)
{
switch (method)
{
case "up":
var top = parseInt(document.getElementById("source_div").style.top);
document.getElementById("source_div").style.top = top - 5;
break;
case "down":
var top = parseInt(document.getElementById("source_div").style.top);
document.getElementById("source_div").style.top = top + 5;
break;
case "left":
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left - 5;
break;
case "right":
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left + 5;
break;
}
}

function turn(method)
{
var i=document.getElementById('show_img').style.filter.match(/\d/)[0]
//alert(i);
i=parseInt(i)+parseInt(method);
//alert(i);
if(i<0)
{
i += 4;
}
if(i>=4)
{
i -= 4;
}
//alert(i);
document.getElementById('show_img').style.filter='progid:DXImageTransform.Microsoft.BasicImage(Rotation='+i+')'
}

function mysub()
{
if(!(document.getElementById("show_img").src.indexOf('d.jpg')>0))
{
alert('请先上传一张照片');
return;
}

var Oform = document.myform;
Oform.width.value = document.getElementById("show_img").width;
Oform.left.value = document.getElementById("source_div").style.left;
Oform.top.value = document.getElementById("source_div").style.top;
if(IE)
{
Oform.turn.value = document.getElementById('show_img').style.filter.match(/\d/)[0];
}
Oform.submit();
}

function get_sc_width()
{
document.getElementById('scwidth').value = screen.width;
}

function jump()
{
if(document.getElementById('show_ava').src == 'http://images.love21cn.com/w3/global/i/nopic_m.jpg')
{
if(confirm('您还没有裁切出您的形象照,确定要离开吗'))
{
location.href = '/register/change_ava.php';
}
else
{
return;
}
}
location.href="/usercp/";
}

function myreview()
{
location.href="#review";
}
这段JS函数 我看不懂 劳驾谁能帮忙注译下 谢谢 最好纤细点
...全文
67 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
第八维 2009-06-06
  • 打赏
  • 举报
回复
我认得这代码,是世纪佳缘那里的吧。
嘿嘿,这个功能我已经实现了和上面的很相似。
woshimoccc 2008-07-09
  • 打赏
  • 举报
回复
<SCRIPT type=text/javascript>
function myprivacy()
{
var Oform = document.getElementById('Form5');
var photo_show = 1;
if(document.getElementById('show_1').checked)
{
var photo_show = 1;
}
if(document.getElementById('show_2').checked)
{
var photo_show = 2;
}
if(document.getElementById('show_3').checked)
{
var photo_show = 3;
}
if(document.getElementById('show_4').checked)
{
var photo_show = 4;
}
if(document.getElementById('show_5').checked)
{
var photo_show = 5;
}
var show_pwd = document.getElementById('show_pwd').value;
document.getElementById('run_fra').src="/register/privacy.php?photo_show="+photo_show+"&show_pwd="+show_pwd;
}


var div_move = 0;
var IE = document.all?true:false;
var tempX,tempY,oldX,oldY;
var have_move = 0;
function grasp()
{
div_move = 1;
if(IE)
{
document.getElementById("source_div").setCapture();
}
}

function free()
{
div_move = 0;
have_move = 0;
if(IE)
{
document.getElementById("source_div").releaseCapture();
}
}

function getMouseXY(e)
{
if (IE)
{ // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
}
else
{
// grab the x-y pos.s if browser is NS
tempX = e.pageX
tempY = e.pageY
}
// catch possible negative values in NS4
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
}

function move_it(e)
{
getMouseXY(e);
if(div_move == 1)
{
if(have_move == 0)
{
//alert('a');
oldX = tempX;
oldY = tempY;
have_move = 1;
}
var left = parseInt(document.getElementById("source_div").style.left);
var top = parseInt(document.getElementById("source_div").style.top);
//alert(top);
//alert(left);
//alert(tempX);
//alert(oldX);

document.getElementById("source_div").style.left = (left + tempX - oldX) + 'px';
document.getElementById("source_div").style.top = (top + tempY - oldY) + 'px';
oldX = tempX;
oldY = tempY;
}
}

function change_size(method)
{
if(method == 1)
{
var per = 1.25;
}
else
{
var per = 0.8;
}
document.getElementById("show_img").width = document.getElementById("show_img").width*per;
//document.getElementById("show_img").height = document.getElementById("show_img").height*per;
}

function load_move()
{
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left + 150;
}

function micro_move(method)
{
switch (method)
{
case "up":
var top = parseInt(document.getElementById("source_div").style.top);
document.getElementById("source_div").style.top = top - 5;
break;
case "down":
var top = parseInt(document.getElementById("source_div").style.top);
document.getElementById("source_div").style.top = top + 5;
break;
case "left":
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left - 5;
break;
case "right":
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left + 5;
break;
}
}

function turn(method)
{
var i=document.getElementById('show_img').style.filter.match(/\d/)[0]
//alert(i);
i=parseInt(i)+parseInt(method);
//alert(i);
if(i<0)
{
i += 4;
}
if(i>=4)
{
i -= 4;
}
//alert(i);
document.getElementById('show_img').style.filter='progid:DXImageTransform.Microsoft.BasicImage(Rotation='+i+')'
}

function mysub()
{
if(!(document.getElementById("show_img").src.indexOf('d.jpg')>0))
{
alert('请先上传一张照片');
return;
}

var Oform = document.myform;
Oform.width.value = document.getElementById("show_img").width;
Oform.left.value = document.getElementById("source_div").style.left;
Oform.top.value = document.getElementById("source_div").style.top;
if(IE)
{
Oform.turn.value = document.getElementById('show_img').style.filter.match(/\d/)[0];
}
Oform.submit();
}

function get_sc_width()
{
document.getElementById('scwidth').value = screen.width;
}

function jump()
{
if(document.getElementById('show_ava').src == 'http://images.love21cn.com/w3/global/i/nopic_m.jpg')
{
if(confirm('您还没有裁切出您的形象照,确定要离开吗'))
{
location.href = '/register/change_ava.php';
}
else
{
return;
}
}
location.href="/usercp/";
}

function myreview()
{
location.href="#review";
}
</SCRIPT>
这个我是在一个网页里弄来的 我是先搞明白 想用这个功能 论坛不让发附件 我找不到JS板块。。。
要不那个大大 可以加我QQ帮我个忙谢谢了 QQ283967713
wheeler 2008-07-09
  • 打赏
  • 举报
回复
代码还没贴全!。。。

大致意思是,按照photo_show(不知道是指ID还是样式)和密码获取图片,并根据鼠标在页面内的位置,使装载有图片的DIV飘动。
wheeler 2008-07-09
  • 打赏
  • 举报
回复
拜托,排个版再拿出来啊!!!

还有,问题贴错版面了!JS有自己的版面滴!


function myprivacy()
{
var Oform = document.getElementById('Form5');
var photo_show = 1;
if(document.getElementById('show_1').checked)
{
var photo_show = 1;
}
if(document.getElementById('show_2').checked)
{
var photo_show = 2;
}
if(document.getElementById('show_3').checked)
{
var photo_show = 3;
}
if(document.getElementById('show_4').checked)
{
var photo_show = 4;
}
if(document.getElementById('show_5').checked)
{
var photo_show = 5;
}
var show_pwd = document.getElementById('show_pwd').value;
document.getElementById('run_fra').src="/register/privacy.php?photo_show="+photo_show+"&show_pwd="+show_pwd;
}


var div_move = 0;
var IE = document.all?true:false;
var tempX,tempY,oldX,oldY;
var have_move = 0;
function grasp()
{
div_move = 1;
if(IE)
{
document.getElementById("source_div").setCapture();
}
}

function free()
{
div_move = 0;
have_move = 0;
if(IE)
{
document.getElementById("source_div").releaseCapture();
}
}

function getMouseXY(e)
{
if (IE)
{
// grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
}
else
{
// grab the x-y pos.s if browser is NS
tempX = e.pageX
tempY = e.pageY
}
// catch possible negative values in NS4
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
}

function move_it(e)
{
getMouseXY(e);
if(div_move == 1)
{
if(have_move == 0)
{
//alert('a');
oldX = tempX;
oldY = tempY;
have_move = 1;
}
var left = parseInt(document.getElementById("source_div").style.left);
var top = parseInt(document.getElementById("source_div").style.top);
//alert(top);
//alert(left);
//alert(tempX);
//alert(oldX);

document.getElementById("source_div").style.left = (left + tempX - oldX) + 'px';
document.getElementById("source_div").style.top = (top + tempY - oldY) + 'px';
oldX = tempX;
oldY = tempY;
}
}

function change_size(method)
{
if(method == 1)
{
var per = 1.25;
}
else
{
var per = 0.8;
}
document.getElementById("show_img").width = document.getElementById("show_img").width*per;
//document.getElementById("show_img").height = document.getElementById("show_img").height*per;
}

function load_move()
{
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left + 150;
}

function micro_move(method)
{
switch (method)
{
case "up":
var top = parseInt(document.getElementById("source_div").style.top);
document.getElementById("source_div").style.top = top - 5;
break;
case "down":
var top = parseInt(document.getElementById("source_div").style.top);
document.getElementById("source_div").style.top = top + 5;
break;
case "left":
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left - 5;
break;
case "right":
var left = parseInt(document.getElementById("source_div").style.left);
document.getElementById("source_div").style.left = left + 5;
break;
}
}

function turn(method)
{
var i=document.getElementById('show_img').style.filter.match(/\d/)[0]
//alert(i);
i=parseInt(i)+parseInt(method);
//alert(i);
if(i <0)
{
i += 4;
}
if(i>=4)
{
i -= 4;
}
//alert(i);
document.getElementById('show_img').style.filter='progid:DXImageTransform.Microsoft.BasicImage(Rotation='+i+')'
}

function mysub()
{
if(!(document.getElementById("show_img").src.indexOf('d.jpg')>0))
{
alert('请先上传一张照片');
return;
}

var Oform = document.myform;
Oform.width.value = document.getElementById("show_img").width;
Oform.left.value = document.getElementById("source_div").style.left;
Oform.top.value = document.getElementById("source_div").style.top;
if(IE)
{
Oform.turn.value = document.getElementById('show_img').style.filter.match(/\d/)[0];
}
Oform.submit();
}

function get_sc_width()
{
document.getElementById('scwidth').value = screen.width;
}

function jump()
{
if(document.getElementById('show_ava').src == 'http://images.love21cn.com/w3/global/i/nopic_m.jpg')
{
if(confirm('您还没有裁切出您的形象照,确定要离开吗'))
{
location.href = '/register/change_ava.php';
}
else
{
return;
}
}
location.href="/usercp/";
}

function myreview()
{
location.href="#review";
}

110,825

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧