一个JS翻页效果

2016-02-19 09:18 170 1 收藏

下面图老师小编要跟大家分享一个JS翻页效果,简单的过程中其实暗藏玄机,还是要细心学习,喜欢还请记得收藏哦!

【 tulaoshi.com - Web开发 】

IFRAME border=0 style="text-align:center" marginWidth=0 marginHeight=0 src="1.htm" frameBorder=no width=200 scrolling=no height=200 style="border: 1px solid #CCCCCC" id="pic"/IFRAME
a href="javascript:Page(-1)"上一页/aa href="javascript:Page(1)"下一页/a
script language="javascript"
var curId = 1;
var maxId = 3;
if (document.location.search) curId = Number(document.location.search.split("?")[1].split("=")[1]);
document.getElementById("pic").src = curId + ".htm";
function Page(id)
{
       if ( id == 0 )
              curId = Number(document.getElementById("page").value);
       else
              curId += id;
       if ( curId  1 )
              curId = 1;
       if ( curId  maxId )
              curId = maxId;
       document.getElementById("pic").src = curId + ".htm";
}
/script
跳转到第
input id="page" type="text" size="5"

input type="button" name="Submit" value="GO" onClick="Page(0)"
以上是我对于一个翻页效果的修改,不知道可不可以,大家帮看看

不知道有没有什么实际意义

来源:https://www.tulaoshi.com/n/20160219/1590264.html

延伸阅读
标签: Web开发
很多语言都有类似php中的include和require功能的函数,而唯独javascript没有。  很早就想在js中实现类似的功能,尝试了很多次都没有成功,那天在google上搜索一些关于动态加载css文件的关键词时,发现一个blog(地址找不到了)上的一个为网页的head标签增加link元素的函数,于是就改了一下,写了这个函数。  用法:  include...
标签: Web开发
function cls_marquee(id,id1,id2,sp){     this.obj_id=id;     this.obj_id1=id1;     this.obj_id2=id2;     this.speed=sp;     eval(this.obj_id2+".innerHTML="+this.obj_id1+".innerHTML");          function Marque...
标签: Web开发
主要是集成了常用的扩展,包括Dom与String、Array、StringBuffer、NameSpace等,当然还少不了Ajax。体积约8k。因为严格控制体积,所以功能有限。如果只要Ajax部分,就1k而已。 这个小框架已经应用到公司的项目,并开始逐步在前端展示页面上接替prototype.js。以后将围绕这个框架做一些应用。 代码如下: /* *    My&n...
标签: Web开发
代码如下: input type=text id=abutton onclick="Session.save('a',a.value);"button onclick="alert(Session.load('a'))" body SCRIPT LANGUAGE="JavaScript" !-- var Session={ isinit:false, init:function(){ SessionObj = document.createElement('input'); SessionObj...
标签: Web开发
/**  * @author tin555  */ function setHTML(html) {     ContentEdit.value = html;         eWebEditor.document.designMode="On";         eWebEditor.document.open();   ...

经验教程

319

收藏

35
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部