• 文字广告位
  • 文字广告位
  • 文字广告位
您现在的位置: 站长手册 >> 特效代码 >> 导航类 >> 正文
站内搜索
Google
[图文]底部滑动的说明图层
          ★★★   

底部滑动的说明图层

雅虎收藏夹 百度收藏 Google书签 Yahoo书签 新浪ViVi 搜狐网摘 365Key网摘 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 Del.icio.us digg reddit spurl BlinkList blogmarks
人气: 来源:本站原创 作者:佚名 所属栏目:导航类 [切换到繁體中文]
介绍:当鼠标经过链接时,从页面底部滑上来一个说明图层。

演示:

[Ctrl+A全选 提示:你可先修改部分代码,再按运行]

下面教你如何应用此特效: 
 --------------------------------------------------------------------------------------
  需要在<body 这里>加入的代码:
 --------------------------------------------------------------------------------------
以下代码加到<head>…</head>中
以下代码加到<body>…</body>中
<script language="JavaScript1.2">
var description=new Array()
description[0]='这是一个链接说明1'
description[1]='<b>这是一个链接说明2'
description[2]='<i>这是一个链接说明3'

//Do not edit below here

iens6=document.all||document.getElementById
ns4=document.layers

<!--GLOBAL VARIABLES-->
var thename
var theobj
var thetext
var winHeight
var winPositionFromTop
var winWidth
var startH=2
var openTimer
<!--END GLOBAL VARIABLES-->

<!--GLOBAL FUNCTIONS-->
function setObj(text,theswitch,inwidth,inheight) {
 thetext=text
 if(iens6){
  thename = "viewer"
  theobj=document.getElementById? document.getElementById(thename):document.all.thename
  winHeight=100
   if(iens6&&document.all) {
    winPositionFromTop=document.body.clientHeight
    winWidth=(document.body.clientWidth-document.body.leftMargin)
   }
   if(iens6&&!document.all) {
    winPositionFromTop=window.innerHeight
    winWidth=(window.innerWidth-(document.body.offsetLeft+30))
   }
   if(theswitch=="override") {
    winWidth=inwidth
    winHeight=inheight
   }
  theobj.style.width=winWidth
  theobj.style.height=startH
   if(iens6&&document.all) {
    theobj.style.top=document.body.scrollTop+winPositionFromTop
    theobj.innerHTML = ""
    theobj.insertAdjacentHTML("BeforeEnd","<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>")
   }
   if(iens6&&!document.all) {
    theobj.style.top=window.pageYOffset+winPositionFromTop
    theobj.innerHTML = ""
    theobj.innerHTML="<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>"
   }
 }
 if(ns4){
  thename = "nsviewer"
  theobj = eval("document."+thename)
  winPositionFromTop=window.innerHeight
  winWidth=window.innerWidth
  winHeight=100
   if(theswitch=="override") {
    winWidth=inwidth
    winHeight=inheight
   }
  theobj.moveTo(0,eval(window.pageYOffset+winPositionFromTop))
  theobj.width=winWidth
  theobj.clip.width=winWidth
  theobj.document.write("<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>")
  theobj.document.close()
 }
 viewIt()
}

function viewIt() {
 if(startH<=winHeight) {
  if(iens6) {
   theobj.style.visibility="visible"
    if(iens6&&document.all) {
     theobj.style.top=(document.body.scrollTop+winPositionFromTop)-startH
    }
    if(iens6&&!document.all) {
     theobj.style.top=(window.pageYOffset+winPositionFromTop)-startH
    }
   theobj.style.height=startH
   startH+=2
   openTimer=setTimeout("viewIt()",10)
  }
  if(ns4) {
   theobj.visibility = "visible"
   theobj.moveTo(0,(eval(window.pageYOffset+winPositionFromTop)-startH))
   theobj.height=startH
   theobj.clip.height=(startH)
   startH+=2
   openTimer=setTimeout("viewIt()",10)
  }
 }else{
  clearTimeout(openTimer)
 }
}

function stopIt() {
 if(iens6) {
  theobj.innerHTML = ""
  theobj.style.visibility="hidden"
  startH=2
 }
 if(ns4) {
  theobj.document.write("")
  theobj.document.close()
  theobj.visibility="hidden"
  theobj.width=0
  theobj.height=0
  theobj.clip.width=0
  theobj.clip.height=0
  startH=2
 }
}
<!--END GLOBAL FUNCTIONS-->
</script>

<layer name="nsviewer" bgcolor="#FFFFCC" style="border-width:thin;z-index:1"></layer>
<script language="JavaScript1.2">
if (iens6){
document.write("<div id='viewer' style='background-color:#FFFFCC;visibility:hidden;position:absolute;left:0;width:0;height:0;z-index:1;overflow:hidden;border:1px ridge white'></div>")
}
if (ns4){
 hideobj = eval("document.nsviewer")
 hideobj.visibility="hidden"
}
</script>
<b>例子</b><br>
<a href="#" onmouseover="setObj(description[1],'override',550,30)"  onmouseout="clearTimeout(openTimer);stopIt()">测试</a>
  • 上一个特效:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    姓 名: *(必填项) ·注册用户·
    Email: QQ号:
    评 分: 1分 2分 3分 4分 5分
    • 您可以发表评论支持你喜欢的文章。
    • 请遵守《互联网电子公告服务管理规定》
    • 请遵守中华人民共和国各项有关法律法规。
    • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
    • 评论人需对自己在使用评论过程中的行为承担法律责任。
    • 本站管理员有权保留或删除评论内容。
    • 评论内容只代表个人观点,与本网站立场无关。
    站内特效搜索
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | | 京ICP备 05004866号 |
    版权所有 2007-2008 站长手册 WWW.ZZSC.ORG 业务联系 zzsc.org#gmail.com