»
EnglishFrenchVietnamese

Print - Set sate of image 2 - JavaScriptBank.com

Full version: jsB@nk » 3D » Set sate of image 2
URL: https://www.javascriptbank.com/examples-test-ns6-clip.html

Set sate of image 2 © JavaScriptBank.comThis JavaScript code can be use set state of objects as images and buttons...but only work with Netscape 6.

Full version: jsB@nk » 3D » Set sate of image 2
URL: https://www.javascriptbank.com/examples-test-ns6-clip.html



CSS
<style type="text/css"><!--body { font-family:Georgia,Trebuchet MS,Arial,Helvetica,sans-serif; font-size:12px; color:black; background-color:#663333; }a:link, a:visited, a:active { color:#9E0B0E; text-decoration:none; }// --></style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script language="JavaScript"><!--/*     This script downloaded from www.JavaScriptBank.com     Come to view and download over 2000+ free javascript at www.JavaScriptBank.com*/var clipbutton1, clipbutton2;function initOnLoad() {fixNetscape();clipbutton1 = new ClipButton("lyrb", 50, 50, 4);trace(clipbutton1);// to access the nested layers, the path is supplied// as well, in this case "parentlayer"// cc = new LyrObj("lyrc", "parentlayer");//clipbutton2 = new ClipButton("lyrd", 50, 50, 4, "parentlayer");// initialize the ClipButtons to state 0 -// setting the state will adjust the clipping// and the button is visible.clipbutton1.setState(0);//clipbutton2.setState(0);}function ping(n) {trace("[ " + n + " ]\n" + clipbutton1 + "\n" + "\n");}function trace(s) {document.forms.debugform.debug.value += s + "\n\n";}//--></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<body onload="initOnLoad()"><div id="fixnetscape" style="position:absolute;visibility:hidden"></div><div id="debugdiv" style="position:absolute; left:400px; top:270px;"><form name="debugform"><textarea name="debug" rows="40" cols="80"  style="font-family:sans-serif; font-size:10px;"></textarea></form></div><div id="debugdiv2" style="position:absolute; left:750px; top:270px;"><form name="debugform2"><textarea name="debug" rows="40" cols="80"  style="font-family:sans-serif; font-size:10px;"></textarea></form></div><!-- THE LAYER SHOWING THE FULL CLIPBUTTON IMAGE --><div id="info2" style="position:absolute; left:400px; top:120px; width:160px; background-color:#F0F0F0; layer-background-color:#F0F0F0; padding:5px">setState of first ClipButton<br><a href="#" onmouseover="if(clipbutton1)clipbutton1.setState(0)">[ 0 ]</a>&nbsp;&nbsp;<a href="#" onmouseover="if(clipbutton1)clipbutton1.setState(1)">[ 1 ]</a>&nbsp;&nbsp;<a href="#" onmouseover="if(clipbutton1)clipbutton1.setState(2)">[ 2 ]</a>&nbsp;&nbsp;<a href="#" onmouseover="if(clipbutton1)clipbutton1.setState(3)">[ 3 ]</a><br><br>setState of second ClipButton<br><a href="#" onmouseover="if(clipbutton2)clipbutton2.setState(0)">[ 0 ]</a>&nbsp;&nbsp;<a href="#" onmouseover="if(clipbutton2)clipbutton2.setState(1)">[ 1 ]</a>&nbsp;&nbsp;<a href="#" onmouseover="if(clipbutton2)clipbutton2.setState(2)">[ 2 ]</a>&nbsp;&nbsp;<a href="#" onmouseover="if(clipbutton2)clipbutton2.setState(3)">[ 3 ]</a><br><br></div><div id="clipped" style="position:absolute;top:20px; left:500px; clip:rect(0,200,40,0); background-color:yellow;"onmouseover="trace('over yellow layer')">This demonstrates Netscape 6&#39;s &quot;event catching outside the clipping area&quot;<br><a href="http://bugzilla.mozilla.org/show_bug.cgi?id=35274" target="_blank">BUG</a><br></div><div id="lyrb" style="position:absolute; left:100px; top:120px; width:50px; height:50px; clip:rect(0px, 0px, 0px, 0px); background-color:#00FF00; layer-background-color:navy; visibility:visible; z-index:1;"><a href="#" onmousedown="if(clipbutton1)clipbutton1.setState(2);ping(2)" onmouseover="if(clipbutton1)clipbutton1.setState(1);ping(1)" onmouseout="if(clipbutton1)clipbutton1.setState(0);ping(0)" onmouseup="if(clipbutton1)clipbutton1.setState(3);ping(3)"><img src="images/clipbuttonexample.gif" width="50" height="200" alt="" border="0"></a></div><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


Files
http://javascriptbank.com/javascript/3d/js/LyrObj.jshttp://javascriptbank.com/javascript/3d/js/ClipButton.jshttp://javascriptbank.com/javascript/3d/examples/images/clipbuttonexample.gif