Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Diem Tran   on Jan 03 In Asp.net Category.

  
Question Answered By: Dinh Tran   on Jan 03

I had already done that bit but the jcsript will be logged accordingly.

I think I am going to use the IFrame version  though, it's just cleaner.



<div id="sp"></div>
<center>
<IFrame id="ifr" name="ifr" src="ifr.htm" width="300" height="300"
scrolling="no" border="0" frameborder="0" ></IFrame>
</center>
<script>
var str = "";
str += "<html>\n";
str += "<body>\n";
str += "<script>\n";
str += " Xprev = 0;\n";
str += " Yprev = 0;\n";
str += " Ypos = 0;\n";
str += " Xpos = 0;\n";
str += " netscape = (document.layers) ? 1 : 0;\n";
str += "\n";
str += " if( netscape ){\n";
str += " window.captureEvents( Event.MOUSEMOVE );\n";
str += " function  nsMouse( evnt ){\n";
str += " Ypos = evnt.pageY;\n";
str += " Xpos = evnt.pageX;\n";
str += " top.window.status = Xpos + \",\" + Ypos;\n";
str += " top.document.getElementById(\"sp\").innerHTML = Xpos + \",\" +
Ypos;\n";
str += " }\n";
str += " window.onMouseMove = nsMouse;\n";
str += " }\n";
str += " else{\n";
str += " function ieMouse() {\n";
str += " Ypos = event.y + document.body.scrollTop;\n";
str += " Xpos = event.x + document.body.scrollLeft;\n";
str += " top.window.status = Xpos + \",\" + Ypos;\n";
str += " top.document.getElementById(\"sp\").innerHTML = Xpos + \",\" +
Ypos;\n";
str += " }\n";
str += " document.onmousemove = ieMouse;\n";
str += " }\n";
str += "<\/script>\n";
str += "<\/body>\n";
str += "<\/html>\n";
ifr.document.write(str);
</script>

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on jscript Or get search suggestion and latest updates.

Related Topics:

Tagged: