`
joerong666
  • 浏览: 418284 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

javascript tooltip (网页的提示效果)

阅读更多

一个很不错的javascript网页提示效果的封装,个人认为style 7,8,9在实际情况最为实用

点这里看演示效果

点这里下载演示

详细分析,请阅读全文

 

 


引用

第一步
<script language="JavaScript1.2" src="js/main.js" type="text/javascript"></script>
将此写在head中

 


引用

第二步
<script language="JavaScript1.2" src="js/style.js" type="text/javascript"></script>
将此写在body中, 个人建议不用这种加载的形式,可把style.js解开直接写在页面中,这有一个好处就是,如果要实现动态的效果的时候可以从数据库直接读取,对其进行替换

 


view plaincopy to clipboardprint?
<script type="text/javascript">  
var FiltersEnabled = 1 // if your not going to use transitions or filters in any of the tips set this to 0  
 
Text[0]=["5dhome.net","Business planning software."]  
Text[1]=["","<b>SimplytheBest DHTML Scripts</b><br>A collection of the best DHTML script and Javascripts on the Web."]  
Text[2]=["Right","This box is right positioned."]  
Text[3]=["Center","This box is center positioned."]  
Text[4]=["Left","This box is left positioned."]  
Text[5]=["Float","This box is float positioned at a (10,10) coordinate, it also floats with the scrollbars so it is always static."]  
Text[6]=["Fixed","This box is fixed positioned at a (150,400) coordinate."]  
Text[7]=["Sticky style","This box will sticky around<br>This is useful when you want to insert a link like this <A href='http://www.5dhome.net'>PlanMagic</A>."]  
Text[8]=["Keep style","This sticks around the mouse."]  
Text[9]=["Left coordinate control","This box is right positioned with a 40 X coordinate."]  
Text[10]=["Top coordinate control","This box is right positioned with a 50 Y coordinate."]  
Text[11]=["Visual effects","This box has a Shadow and a bit of Transparency. It also has a random Transition effect applied to it."]  
Text[12]=["Different style","This has a whole new style!"]  
Text[13]=["","<b>PlanMagic Business Software:</b><ul><li>Business plan<li>Marketing plan<li>Financial plan<li>Construction plan<li>Bar business plan<li>Restaurant plan<li>Hotel business plan<li>Resort business plan</ul>"]  
 
 
Style[0]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,10,"","","","",""]  
Style[1]=["white","black","#cc0000","#FFCC99","","","","","","","center","","","",200,"",2,2,10,10,"","","","",""]  
Style[2]=["white","black","#cc0000","#FFCC99","","","","","","","left","","","",200,"",2,2,10,10,"","","","",""]  
Style[3]=["white","black","#cc0000","#FFCC99","","","","","","","float","","","",200,"",2,2,10,10,"","","","",""]  
Style[4]=["white","black","#cc0000","#FFCC99","","","","","","","fixed","","","",200,"",2,2,150,400,"","","","",""]  
Style[5]=["white","black","#cc0000","#FFCC99","","","","","","","","sticky","","",200,"",2,2,10,10,"","","","",""]  
Style[6]=["white","black","#cc0000","#FFCC99","","","","","","","","keep","","",200,"",2,2,10,10,"","","","",""]  
Style[7]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,40,10,"","","","",""]  
Style[8]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,50,"","","","",""]  
Style[9]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,10,51,0.5,75,"simple","gray"]  
Style[10]=["white","black","black","white","","","right","","Tahoma","cursive","center","",3,4,200,20,5,10,10,0,50,1,70,"complex","gray"]  
Style[11]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,10,51,0.5,45,"simple","gray"]  
Style[12]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,10,51,1,0,"",""]  
 
applyCssFilter()  
</script>  
<script type="text/javascript">
var FiltersEnabled = 1 // if your not going to use transitions or filters in any of the tips set this to 0

Text[0]=["5dhome.net","Business planning software."]
Text[1]=["","<b>SimplytheBest DHTML Scripts</b><br>A collection of the best DHTML script and Javascripts on the Web."]
Text[2]=["Right","This box is right positioned."]
Text[3]=["Center","This box is center positioned."]
Text[4]=["Left","This box is left positioned."]
Text[5]=["Float","This box is float positioned at a (10,10) coordinate, it also floats with the scrollbars so it is always static."]
Text[6]=["Fixed","This box is fixed positioned at a (150,400) coordinate."]
Text[7]=["Sticky style","This box will sticky around<br>This is useful when you want to insert a link like this <A href='http://www.5dhome.net'>PlanMagic</A>."]
Text[8]=["Keep style","This sticks around the mouse."]
Text[9]=["Left coordinate control","This box is right positioned with a 40 X coordinate."]
Text[10]=["Top coordinate control","This box is right positioned with a 50 Y coordinate."]
Text[11]=["Visual effects","This box has a Shadow and a bit of Transparency. It also has a random Transition effect applied to it."]
Text[12]=["Different style","This has a whole new style!"]
Text[13]=["","<b>PlanMagic Business Software:</b><ul><li>Business plan<li>Marketing plan<li>Financial plan<li>Construction plan<li>Bar business plan<li>Restaurant plan<li>Hotel business plan<li>Resort business plan</ul>"]


Style[0]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,10,"","","","",""]
Style[1]=["white","black","#cc0000","#FFCC99","","","","","","","center","","","",200,"",2,2,10,10,"","","","",""]
Style[2]=["white","black","#cc0000","#FFCC99","","","","","","","left","","","",200,"",2,2,10,10,"","","","",""]
Style[3]=["white","black","#cc0000","#FFCC99","","","","","","","float","","","",200,"",2,2,10,10,"","","","",""]
Style[4]=["white","black","#cc0000","#FFCC99","","","","","","","fixed","","","",200,"",2,2,150,400,"","","","",""]
Style[5]=["white","black","#cc0000","#FFCC99","","","","","","","","sticky","","",200,"",2,2,10,10,"","","","",""]
Style[6]=["white","black","#cc0000","#FFCC99","","","","","","","","keep","","",200,"",2,2,10,10,"","","","",""]
Style[7]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,40,10,"","","","",""]
Style[8]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,50,"","","","",""]
Style[9]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,10,51,0.5,75,"simple","gray"]
Style[10]=["white","black","black","white","","","right","","Tahoma","cursive","center","",3,4,200,20,5,10,10,0,50,1,70,"complex","gray"]
Style[11]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,10,51,0.5,45,"simple","gray"]
Style[12]=["white","black","#cc0000","#FFCC99","","","","","","","","","","",200,"",2,2,10,10,51,1,0,"",""]

applyCssFilter()
</script>

 

引用

第三步
在body中具体使用函数
<A href="yourpage.html" onMouseOver="stm(Text[0],Style[6])" onMouseOut="htm()">Your text [0][6]</A>
<A href="yourpage.html" onMouseOver="stm(Text[0],Style[7])" onMouseOut="htm()">Your text [0][7]</A>
<A href="yourpage.html" onMouseOver="stm(Text[0],Style[8])" onMouseOut="htm()">Your text [0][8]</A>

 

  • tooltip.zip (6.1 KB)
  • 描述: 源代码
  • 下载次数: 194
分享到:
评论

相关推荐

    Javascript tooltip

    5. **动画效果**:为了增强用户体验,还可以添加淡入淡出、滑动等动画效果,这可以通过CSS3的过渡(transition)或JavaScript的setTimeout函数实现。 6. **防止快速移动鼠标导致闪烁**:为了避免用户快速移动鼠标时...

    纯js tooltip工具提示插件

    纯JS Tooltip工具提示插件是无需依赖任何外部库(如jQuery)的JavaScript代码,它能帮助开发者轻松创建自定义的、动态的提示效果。这种插件对于优化用户体验,尤其是在空间有限或者需要展示额外信息的情况下非常有用...

    jquery Tooltip简易文本提示框插件

    jQuery Tooltip 是一个非常实用的JavaScript库,用于在网页上创建具有动态效果的提示框。这个插件基于流行的jQuery框架,可以轻松地为任何元素添加提示功能,为用户提供更丰富的交互体验。下面将详细介绍jQuery ...

    9种经典的tooltip信息提示框

    标题中的“9种经典的tooltip信息提示框”是指在网页设计中,使用tooltip这一元素来提供额外信息的一种常见方法。Tooltip通常用于在鼠标悬停在某个元素上时显示额外的提示信息,无需用户进行任何交互操作。这些提示框...

    JavaScript 渐变链接提示tooltip封装类

    总的来说,"JavaScript 渐变链接提示tooltip封装类"是一个集成了渐变效果、事件处理、DOM操作、定位算法、动画效果以及可配置性的实用工具,它提升了网页链接的互动性和用户体验。开发者可以方便地在自己的项目中...

    jQuery tooltip 提示插件

    总的来说,jQuery Tooltip插件结合了jQuery的便利性和AJAX的动态性,提供了一种高效、灵活的网页提示解决方案。通过熟练掌握并应用这类插件,开发者可以为用户创造更富交互性和信息性的网页体验。

    tooltip动态提示框zip

    在给定的“tooltip动态提示框zip”文件中,我们可以推测这是一个包含JavaScript(JS)实现的动态提示框效果的代码资源。这种特效可以提升用户的体验,因为它可以在用户悬停在特定元素上时,适时地显示相关信息,而...

    ToolTip提示脚本文件

    【ToolTip提示脚本文件】 在IT领域,ToolTip是一种常见的用户界面元素,用于向用户提供额外的信息。当鼠标指针悬停在某个元素上时,ToolTip会显示一个包含详细说明的小窗口,帮助用户理解该元素的功能或内容。在...

    漂亮的ToolTip效果(Web).rar

    在网页设计中,Tooltip是...综上所述,"漂亮的ToolTip效果(Web)"这个资源可能包含了一系列关于如何在Web项目中创建美观且功能强大的Tooltip的实例代码、样式示例和指导文档,帮助开发者提升网页的交互性和用户体验。

    HTML5 SVG带弹性动画效果的Tooltip提示框

    总之,“HTML5 SVG带弹性动画效果的Tooltip提示框”是一个结合了HTML5、SVG和JavaScript动画技术的创新实践,展示了如何通过技术手段提升用户体验,使网页设计更具活力。开发者可以通过学习和理解这个项目,提升自己...

    jQuery Tooltip跟随鼠标提示条

    jQuery Tooltip插件则是利用jQuery的灵活性和易用性来实现这一功能,允许开发者轻松地为网页元素添加动态提示效果。 在描述中提到的"处于四个角落时,自动变换位置",意味着这个jQuery Tooltip插件具有智能定位功能...

    JavaScript、GridView、TOOLTIP各种使用技巧

    JavaScript是一种广泛应用于网页和网络应用开发的脚本语言,它主要负责处理客户端的交互和动态效果。在网页中,JavaScript可以实现用户输入验证、页面动态更新、AJAX异步通信等功能,极大地提升了用户体验。 ...

    css3动画网页提示插件Tooltip.zip

    "css3动画网页提示插件Tooltip.zip"是一个包含CSS3动画效果的提示插件,能够为网页增加动态视觉效果并提升用户体验。下面将详细探讨这个插件的关键知识点。 首先,CSS3是层叠样式表的第三个主要版本,引入了许多新...

    css3动画网页提示插件Tooltip

    "css3动画网页提示插件Tooltip"是这样一种工具,它结合了CSS3技术,为提示信息增加了动态效果,提高了用户体验。CSS3是层叠样式表的第三个主要版本,引入了许多新特性和改进,包括动画、过渡和3D变换等,这些都使得...

    js-css-tooltip是一款使用js和css3制作的tooltip工具提示插件

    总结,`js-css-tooltip`插件通过JavaScript和CSS3的组合,为网页设计师提供了一个高效、可定制的Tooltip解决方案。它不仅提供了流畅的动画效果,而且易于集成和扩展,为网页增色不少。无论是在信息展示还是用户体验...

    经典页面提示脚本(toolTip),内含例子

    本压缩包文件中的“toolTip 提示 脚本 boxover”可能是一个JavaScript库或插件,用于创建自定义的Tooltip效果。"boxover"可能是该脚本的名字,暗示它提供了一种特定样式的Tooltip显示方式,可能是带有边框或阴影的...

    纯css实现(无脚本)Html指令式tooltip文字提示效果

    【纯CSS实现HTML指令式Tooltip文字提示效果】 在网页设计中,Tooltip是一种常见的交互元素,它可以在用户将鼠标悬停在某个元素上时显示额外的信息。通常,Tooltip的实现依赖于JavaScript来处理显示和隐藏的逻辑。...

Global site tag (gtag.js) - Google Analytics