JQuery 实例:标签切换
2017-12-19 16:43
351 查看
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>标签切换</title> <style> .title { width:100px; height:25px; border:1px solid red; margin:3px; float:left; } .content { width:430px; height:300px; border:1px solid blue; clear:both; } </style> <script src="scripts/jquery-1.7.1.min.js"></script> <script> $(function() { var divContent = $('.content'); $(".title").mouseover(function(){ switch (this.id) { case "0": divContent.html('<h1>西安,泉州,丝绸之路</h1>'); break; case "1": divContent.html('<h1>互联网++</h1>'); break; case "2": divContent.html('<h1>配置实体</h1>'); break; case "3": divContent.html('<h1>天行山</h1>'); break; } }); }); </script> </head> <body> <div class="title" id="0">一带一路</div> <div class="title" id="1">互联网+</div> <div class="title" id="2">亚投行</div> <div class="title" id="3">京津冀</div> <div class="content"></div> </body> </html>
相关文章推荐
- 实例:jQuery实现标签切换
- jQuery切换标签选中样式的简洁写法【实例】
- jQuery实现企业网站横幅焦点图切换功能实例
- JS和jQuery通过this获取html标签中的属性值(实例代码)
- 使用jQuery实现简单的tab栏标签切换
- jQuery插件_SuperSlide插件(焦点图切换、标签切换、多个slide组合)
- jquery切换tab标签例子
- DIY jquery plugin - tabs标签切换实现代码
- jquery实用代码 - 多标签切换显示内容效果
- Jquery基础_点击按钮使div背景变色_根据class_根据标签_所有都变色_一直动画_实例(二)
- jQuery实现平滑滚动的标签分栏切换效果
- jquery tab选项卡切换实例
- jQuery - 综合实例 - 文本输入框与标签自动更换
- jQuery+CSS实现滑动的标签分栏切换效果
- jQuery实现企业网站横幅焦点图切换功能实例
- jquery制作的tab标签切换选项卡
- jQuery实现平滑滚动的标签分栏切换效果
- Viewpager+标签切换动画实例
- jquery实现标签切换效果
- jquery仿凡客诚品图片切换的效果实例代码