最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
js实现上下左右弹框划出效果
时间:2017-06-07 编辑:简简单单 来源:一聚教程网
效果图:
图(1)初始图
图(2)点击“从右侧划出”
代码如下:
代码如下 | 复制代码 |
右侧划出
左侧划出
从上面划下
从上面划下
$(function(){ var rightBtn = $('#rightBtn'),leftBtn = $('#leftBtn'),topBtn = $('#topBtn'),botBtn = $('#botBtn'); var oAside = $('#aside'); rightBtn.on("click",function(){ $('.leftContent').hide(); $('.topContent').hide(); $('.botContent').hide(); $('.rightContent').show(); oAside.addClass('active'); }); leftBtn.on("click",function(){ $('.rightContent').hide(); $('.topContent').hide(); $('.botContent').hide(); $('.leftContent').show(); oAside.addClass('active'); }); topBtn.on("click",function(){ $('.rightContent').hide(); $('.leftContent').hide(); $('.botContent').hide(); $('.topContent').show(); oAside.addClass('active'); }); botBtn.on("click",function(){ $('.rightContent').hide(); $('.leftContent').hide(); $('.topContent').hide(); $('.botContent').show(); oAside.addClass('active'); }); $('.hideAside').on("click",function(){ oAside.removeClass('active'); }); })
|
-
下一个: 正则 js分转元带千分符号详解
相关文章
- js实现炫酷的左右轮播图 02-04
- js控制键盘左右键翻页特效代码 05-24
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31