Jump to content

javascript-image big


gongpex

Recommended Posts

hello everyone,a few days ago I found javascript code like this:

<HTML><HEAD><TITLE>Mouseover Help Box</TITLE><script LANGUAGE="JavaScript" type="text/javascript">var IB=new Object;var posX=0;posY=0;var xOffset=35;yOffset=10;function ShowHelpbox(texte) {  contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=2 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE> ";  var finalPosX=posX-xOffset;  if (finalPosX<0) finalPosX=0;  if (document.layers) {	document.layers["bulle"].document.write(contenu);	document.layers["bulle"].document.close();	document.layers["bulle"].top=posY+yOffset;	document.layers["bulle"].left=finalPosX;	document.layers["bulle"].visibility="show";}  if (document.all) {	bulle.innerHTML=contenu;	document.all["bulle"].style.top=posY+yOffset;	document.all["bulle"].style.left=finalPosX;	document.all["bulle"].style.visibility="visible";  }    else if (document.getElementById) {	document.getElementById("bulle").innerHTML=contenu;	document.getElementById("bulle").style.top=posY+yOffset;	document.getElementById("bulle").style.left=finalPosX;	document.getElementById("bulle").style.visibility="visible";  }}function getMousePos(e) {  if (document.all) {  posX=event.x+document.body.scrollLeft;   posY=event.y+document.body.scrollTop;  }  else {  posX=e.pageX;   posY=e.pageY;   }}function HideHelpBox() {	if (document.layers) {document.layers["bulle"].visibility="hide";}	if (document.all) {document.all["bulle"].style.visibility="hidden";}	else if (document.getElementById){document.getElementById("bulle").style.visibility="hidden";}}function InitHelpBox(ColTexte,ColFond,ColContour,NbPixel) {	IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;	if (document.layers) {		window.captureEvents(Event.MOUSEMOVE);window.onMouseMove=getMousePos;		document.write("<LAYER name='bulle' top=0 left=0 visibility='hide'></LAYER>");	}	if (document.all) {		document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");		document.onmousemove=getMousePos;	}		else if (document.getElementById) {			document.onmousemove=getMousePos;			document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");	}}</SCRIPT></HEAD><BODY><script language="JavaScript">InitHelpBox("#FF0088","#cccccc","#000000",1);</SCRIPT>Mouse over ths link below to see what apear<br><A href="#" onMouseOver="ShowHelpbox('ruby')" onMouseOut="HideHelpBox()">hello</A><BR><A href="#" onMouseOver="ShowHelpbox('This script allow you to include <big><b>html code</b></big>, <br>multilines<br>and<br>more !!<br><center><IMG src=\'img-scripts/demo_1.jpg\' width=100></center>')" onMouseOut="HideHelpBox()">Second test link</A><BR><BR><a href="#" onMouseOver="ShowHelpbox('<img src=\'trustJesus.png\'></center>')" onMouseOut="HideHelpBox()"><img src="../../sanctuarymarket/project/webImage/religion/Trust-Jesus.png" border="0" /></A><BR></A><BR><CENTER><A href="http://www.4wsearch.com" onMouseOver="ShowHelpbox('www.4wsearch.com :<LI>search website,<LI>easier,<LI>faster.<BR><CENTER><B>We share other scripts...</B><BR></CENTER>')" onMouseOut="HideHelpBox()">www.4wsearch.com</A></CENTER></FONT></BODY></HTML>

can someone tell to me what's the mean of this script?what the mean of "document.layer" and "document.all" where I can found the list of "document....."I confuse about this scriptplease help methank you very much

Link to comment
Share on other sites

Throw away that script and find another. Or describe what you want it to do and ask for help.The techniques you mentioned were only useful for 2-3 years, back during the 1990s browser wars, when document.layers was a way of knowing that your browser was Netscape, and document.all was a way of knowing that the browser was Explorer. One problem today is that the layers property DOES NOT EXIST, so it is useless.There are also better, and more universal, ways of doing what you seem to want. All browsers are more sophisticated today than the versions that script attempts to work with.(Do you really want to use a script that is more than 50% the age of HTML? That's like buying a 1945 Ford and getting excited because it's a "new" car.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...