SoFunction
Updated on 2025-04-13

JS code judgment highlight page 5/5

JS code judgment highlight page 5/5

Updated: December 6, 2007 21:15:02 Submission: mdxy-dxy
This article introduces the method of JS code to you through the example code. The code is simple and easy to understand, very good, and has certain reference value. If you need it, please refer to it.
Advertising JS code effects collection ~~~~~~~~~ 4.[Floating couplet ad---left code] If you want only one side to display, the following is the code required to achieve the left-side effect: var ad_float_left_src ="Image address"; var ad_float_left_url ="Address"; var ad_float_left_type = ""; = == "Microsoft Internet Explorer" var imgheight_close var imgleft >800 ? imgheight_close=120:imgheight_close=120 >800 ? imgleft=8:imgleft=122 function myload() { =+ t-imgheight_close; =imgleft; leftmove(); } function leftmove() { =+ t-imgheight_close; =imgleft; setTimeout("leftmove();",50) } function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) { if ((appName=="Netscape")&& (parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight! =document.MM_pgH) (); } MM_reloadPage(true) function close_float_left(){ ='hidden'; } ("<div id=myleft style='position: absolute;width:80;top:300;left:5;visibility: visible;z-index: 1'>" +"<style>" +":link,:visited {text- decoration:none;color:#000000;font-size:12px}" +":active,:hover {text-decoration:underline;color:#0000FF;font-size:12px}" +"</style>" +"<table border=0 cellpadding=0 cellpacing=0><tr><td>"); if(){ if(ad_float_left_type!="swf") ("<a href='" + ad_float_left_url + "' target = '_blank'><img src='" + ad_float_left_src + "' WIDTH=88 height=31 border=0></a>"); else ("<EMBED src='" + ad_float_left_src + "' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave- flash' id=changhongout ></EMBED>"); ("</td></tr><tr><td width=80 height=20 align=right><a href='javascript:close_float_left( target=_blank);void(0);' class=closefloat><b><font color=#ff0000>Close</font></b></a></td></tr>" +"</table>" +"</table>" +"</div>"); myload()} [ 5. Rear projection ads] <script language="javascript"> <!-- var sohu=(''); var ads=('about:blank','ads','width=700,height=400'); (); ("<html><head><title>ads</title></head><body>This is background ads</body></html>"); (); //--> </script> [ 6. Shrink ads] <script language="javascript"> <!-- var bwidth=800; var bheight=400; function go() { bwidth = bwidth - 10; bheight = bheight - 5; if(bwidth <= 10) { ='none';clearTimeout("my"); } else { ='<span style="width:'+bwidth+'px;height:'+bheight+'px;background-color:#0099FF;"></span>';} var my=setTimeout("go()",50); } setTimeout("go()",6000); //--> </script> <body topmargin="0" leftmargin="0"> <div align="center"><span style="width:800px;height:400px;background-color:#0099FF"></span></div> </body> ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** Just call <script src="*.js"></SCRIPT>, * represents the file name you saved! Pay attention to modifying the ad image address and connection address! The corresponding parameters can be adjusted according to the page js slide player~~~~~~~~~~~ var _c = 0; var _i = 0; var _v = 0; var _l = 0; var _sf = 3000; var _html = null; var _image = null; var _mycars= new Array(); var _w = new Array(); var _h = new Array(); function adRotator() {} function (p,w,h) { _mycars[_c] = p; _w[_c] = w; _h[_c] = h; _c = _c + 1; } /* Playback settings */ function () { if (_i < _mycars.length && _l < 1) { _html = '<img src="' + _mycars[_i] + '" width="' + _w[_i] + '" height="' + _h[_i] + '" style="border:1px solid #CCCCCC;">' if (_v < 1) { ('image').value = _html + ',' + _i; ('rotatorPlayer').innerHTML = _html; _i = _i + 1; ('backs').disabled=''; ("("+_i+")",_sf); } } else { _html = '<img src="' + _mycars[_i] + '" width="' + _w[_i] + '" height="' + _h[_i] + '" style="border:1px solid #CCCCCC;">' ('image').value = _html + ',' + _i; ('rotatorPlayer').innerHTML = _html; } if (_i+1 > _mycars.length) { ('stops').disabled='True'; ('play').disabled=''; ('backs').disabled=''; ('next').disabled='True'; _i = 0; _v = 1; } } /* Play */ function () { _v = 0; _l = 0; (); } /* Next */ function () { _l = 1; if(_i+1 < _mycars.length) { _i = _i + 1; ('play').disabled=''; ('stops').disabled='True'; ('backs').disabled=''; (); } else { ('next').disabled='True'; } } /* Previous */ function () { _l = 1; if(_i-1 < 0) { ('backs').disabled='True'; } else { _i = _i - 1; ('play').disabled=''; ('stops').disabled='True'; ('next').disabled=''; (); } } /* Interval time */ function () { var _sfc = ('second').value; if (isInteger(_sfc)) { _sf = _sfc * 1000; } else { alert('Tip: Only enter numbers! '); ('second').value=1; ('second').select(); } } /* Character detection */ function isInteger(str) { var regu = /^[-]{0,1}[0-9]{1,}$/; return (str); } /* Pause */ function () { _v = 1; } /* Add image, and pay attention to the image name. The next 400,300 is the size */ ("",400,300); ("",400,300); ("",400,300); Save the above file as a JS file and reference it in the following file <style type="text/css"> <!-- body { font-size:12px; } input { border-right: #7b9ebd 1px solid; padding-right: 2px; border-top: #7b9ebd 1px solid; padding-left: 2px; font-size: 12px; filter: progid:(GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde); border-left: #7b9ebd 1px solid; cursor: hand; color: black; padding-top: 2px; border-bottom: #7b9ebd 1px solid; } button { border-right: #7b9ebd 1px solid; padding-right: 2px; border-top: #7b9ebd 1px solid; padding-left: 2px; font-size: 12px; filter: progid:(GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde); border-left: #7b9ebd 1px solid; cursor: hand; color: black; padding-top: 2px; border-bottom: #7b9ebd 1px solid; } --> </style> <script language="javascript" src=""> </script> <body > <div ></div> <input type="button" name="play" value="Start playback" disabled="True"/> <input type="button" name="stops" value="pause" /> <input type="button" name="backs" value="Previous" disabled="true"/> <input type="button" name="next" value="next" /> <input type="text" value="3" size="3" maxlength="2"> Seconds <input type="button" value="set time" /> <input name="image" type="text" size="65"/> A very good player, but unfortunately if the picture is very large, the result will be a bit miserable!

Summarize

The above is a collection of JS code judgments introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!

Previous page12345Read the full text