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

Ò»¸öͨÓõÄJavaScript·ÖÒ³


Ò»¸öͨÓõÄJavaScript·ÖÒ³
1.JavaScript´úÂë
Pagination=function(id)
{
var totalNum=0;
var maxNum=10;
var pageUrl="";
var breakpage = 5;
var currentposition = 0;
var breakspace = 2;
var maxspace = 4;
var currentpage=1;
var perpage=10;
var id =id;
this.initPage = function(pageName)
{
var count = this.getTotalNum();
perpage = this.getMaxNum();
if (currentpage==null){
currentpage = 1;
}else{
currentpage = parseInt(currentpage);
}
var pagecount = Math.floor(count/perpage)+1;

var pagestr = "";
var prevnum = currentpage-currentposition;
var nextnum = currentpage+currentposition;
if(prevnum<1) prevnum = 1;
if(nextnum>pagecount) nextnum = pagecount;
pagestr += (currentpage==1)?'<span class="disabled"> <ÉÏÒ»Ò³</span>':'<span><a href="javascript:'+pageName+'.page_onclick('+(this.getIndexPage()-1)+',\''+pageName+'\')"><ÉÏÒ»Ò³</a></span>';
if(prevnum-breakspace>maxspace){
for(i=1;i<=breakspace;i++)
pagestr += '<a href="javascript:'+pageName+'.page_onclick('+i+',\''+pageName+'\')">'+i+'</a>';
pagestr += '...';
for(i=pagecount-breakpage+1;i<prevnum;i++)
pagestr += '<a href="javascript:'+pageName+'.page_onclick('+i+',\''+pageName+'\')">'+i+'</a>';
}else{
for(i=1;i<prevnum;i++)
pagestr += '<a href="javascript:'+pageName+'.page_onclick('+i+',\''+pageName+'\')">'+i+'</a>';
}
for(i=prevnum;i<=nextnum;i++){
pagestr += (currentpage==i)?'<span class="current">'+i+'</span>':'<a href="javascript:'+pageName+'.page_onclick('+i+',\''+pageName+'\')">'+i+'</a>';
}
if(pagecount-breakspace-nextnum+1>maxspace){
for(i=nextnum+1;i<=breakpage;i++)
pagestr += '<a href="javascript:'+pageName+'.page_onclick('+i+',\''+pageName+'\')">'+i+'</a>';
pagestr += '<span class="break">...</sp


Ïà¹ØÎĵµ£º

jsÈçºÎʵÏÖÔÚÒ³ÃæÍêÈ«¼ÓÔØºóÖ´ÐÐjavascriptº¯Êý

jsÈçºÎʵÏÖÔÚÒ³ÃæÍêÈ«¼ÓÔØºóÖ´ÐÐjavascriptº¯Êý»ò/´úÂëÄØ?
¿ÉÒÔÊÇÒÔϼ¸ÖÖ
<body onload="function name()" > </body  >
<script >window.onload=function name </script >
<script language="javascript" for="window" event="onload" >function name(); </script >
µ ......

javascriptС¼¼ÇÉ

ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture(); 
event.srcElement.releaseCapture(); 
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
event.x
event.y
´°Ìå ......

Javascript DOMѧϰ±Ê¼Ç1


·µ»ØÒ»¸ö¸ø¶¨idÊôÐÔÖµµÄÔªËØ½ÚµãµÄ¶ÔÏó
document.getElememtById(id) 
·µ»ØÒ»¸ö°üº¬ËùÓиø¶¨±êÇ©µÄÔªËØµÄÊý×é 
document.getElementsByName(tag)
»ñÈ¡ÔªËØÊôÐÔ
document.getAttribute(attribute)
ÉèÖÃÔªËØÊôÐÔÖµ
document.setAttribute(attribute)
......

javascript,js»ñµÃ¿Í»§¶Ë¼ÆËã»úIP»òÃû³Æ·½·¨

1¡¢rcbdyctl
view plaincopy to clipboardprint?
<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html;   
charset=gb2312">  
<title>JS»ñÈ¡¿Í»§¶ËIP</title>  
</head>  
<b ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ