Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScript counter

µ±Ò³Ãæ¼ÓÔØÒÔºó£¬Ö´ÐÐJavaScript£¬°´Ã뿪ʼ¼ÆÊý£º
JavaScript function£º
<SCRIPT language="JavaScript">
<!--Timer in JavaScript
var timerform
speed=1000
function dotimer()
{
today=new Date()
slutsec=today.getSeconds()
slutmin=today.getMinutes()
sluttim=today.getHours()
sluta=(slutsec) + 60 * (slutmin) + 3600 * (sluttim)
diff=sluta - starta
tim=Math.floor(diff / 3600)
min=Math.floor((diff / 3600 - tim) * 60)
sek=Math.round((((diff / 3600 - tim) * 60) - min) * 60)
document.timerform.timer.value=tim + ':'
if(min<10)document.timerform.timer.value+='0'
document.timerform.timer.value+=min + ':'
if(sek<10)document.timerform.timer.value+='0'
document.timerform.timer.value+=sek
window.setTimeout("dotimer()",speed)
}
function Timer()
{
today=new Date()
startsek=today.getSeconds()
startmin=today.getMinutes()
starttim=today.getHours()
starta=(startsek) + 60 * (startmin) + 3600 * (starttim)
document.write('<form name=timerform><input name=timer size=7')
document.write('></form>')
dotimer()
}
// end-->
</SCRIPT>
HTML£º
<table width=420>
<tr>
<td align=center>
TIMER:
<SCRIPT language="JavaScript">
Timer()
</SCRIPT>
</td>
</tr>
</table>
ʵÏÖЧ¹û£º http://www.javascriptsearch.com/scripts/Counters/simple_counter.html


Ïà¹ØÎĵµ£º

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

IEÓëFirefoxÏÂjavascript getyearÄê·ÝµÄ¼æÈÝÐÔд·¨

                    Ç°¼¸ÌìÔÚ²âÊÔÍøÕ¾¼æÈÝÐÔÎÊÌ⣬·¢ÏÖÔ­À´ÔÚIEÏÂÃæÕý³£µÄÏÔʾʱ¼äÔÚFirefox»ñÈ¡Äê·ÝÏÂÏÔʾ109
                &nb ......

JavaScript¶¯Ì¬Éú³ÉÊ÷Ðβ˵¥´´½¨±í¸ñ

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>ÎÞÏÞ¼¶Ê÷Ð ......

javascript ¶¯Ì¬¼ÓÔØcss¡¢js

¼æÈÝIE¡¢FireFox¡¢Chrome
//¼ÓÔØjs
function loadJs(){
    if (!getObj('script_PlData')){
        var scriptObj= document.createElement("script");
        //scriptObj.id = 'script_1';
    &nb ......

$wnd and $doc Calling native JavaScript with JSNI

$wnd and $doc Calling native JavaScript with JSNI
$wnd ÊÇʲô£¿
GWT provides the $wnd and $doc variables to refer to the window and document objects
GWTʹÓÃͨ¹ýJava Native methodʹÓÃËü£¬ÉùÃ÷Ò»¸önative·½·¨£¬½«º¬ÓÐJavaScriptµÄ·½·¨Ìå×¢ÊÍ¡£±àÒëÆ÷½«×¢ÊÍ¿éÄÚµÄÄÚÈÝÖð×ÖÊä³ö£¬Ê¹Ö®Óë±àÒë²úÉúµÄJavaScriptÕûº ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ