两个完整的jquery slide多方面滑动效果实例
实例1,需要引用jquery-ui.js
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" src="jquery-ui-1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
jQuery.fn.extend({
slideRightShow: function() {
return this.each(function() {
$(this).show('slide', {direction: 'right'}, 1000);
});
},
slideLeftHide: function() {
return this.each(function() {
$(this).hide('slide', {direction: 'left'}, 1000);
});
},
slideRightHide: function() {
return this.each(function() {
$(this).hide('slide', {direction: 'right'}, 1000);
});
},
slideLeftShow: function() {
return this.each(function() {
$(this).show('slide', {direction: 'left'}, 1000);
});
}
}); $(function(){
$("body").on("click","a#show",function(){
$("#test").slideRightShow();
});
$("body").on("click","a#hide",function(){
$("#test").slideRightHide();
});
});
</script>
</head> <body>
<div id="test" style="position:absolute;">asdfasdf</div>
<br />
<a href="javascript:void(0)" id="show">显示</a>
<a href="javascript:void(0)" id="hide">隐藏</a>
</body>
</html>
实例二:
<html>
<head>
<script type="text/javascript" src="jquery-1.8.2.js"></script>
<script type="text/javascript">
jQuery.fn.slideLeftHide = function( speed, callback ) {
this.animate({
width : "hide",
paddingLeft : "hide",
paddingRight : "hide",
marginLeft : "hide",
marginRight : "hide"
}, speed, callback );
};
jQuery.fn.slideLeftShow = function( speed, callback ) {
this.animate({
width : "show",
paddingLeft : "show",
paddingRight : "show",
marginLeft : "show",
marginRight : "show"
}, speed, callback );
};
</script>
<script type="text/javascript">
$(function() {
$(".title_bar").slideLeftHide(4000);
$(".title_bar").slideLeftShow(4000);
});
</script> </head>
<body> <div class="title_bar">
asdfasfasdfas
</div>
</body>
</html>
两个完整的jquery slide多方面滑动效果实例的更多相关文章
- Jquery Mobile左右滑动效果
首先在一个页面里面定义两个< div data-role="page">,这里为了突出重点,就没有写出footer和header.定义的页面如下: <body&g ...
- 8.jQuery之上下滑动效果
上下滑动:slideDown slideUp slideToggle <style> div { width: 150px; height: 300px; background-co ...
- jquery的slideUp、slideDown、slideToggle等涉及滑动效果的一系列函数,在IE浏览器下有几处bug
jquery的slideUp.slideDown.slideToggle等涉及滑动效果的一系列函数,在IE浏览器下有几处bug: 1. 因position引起的问题 影响:IE全系列 症状:在需要sl ...
- jquery mobile左右滑动切换页面
jquery mobile左右滑动切换页面 $(function() {$("body").bind('swiperight', function() { $.mobile.ch ...
- spring cloud和spring boot两个完整项目
spring cloud和spring boot两个完整项目 spring cloud 是基于Spring Cloud的云分布式后台管理系统架构,核心技术采用Eureka.Fegin.Ribbon.Z ...
- js进阶 13-2 jquery动画滑动效果哪些注意事项
js进阶 13-2 jquery动画滑动效果哪些注意事项 一.总结 一句话总结:滑动里面这里up是隐藏,down是显示. 1.jquery动画默认的两个切换效果是什么(swing默认和linear的区 ...
- Jquery实现特效滑动菜单栏
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 基于 jQuery 实现垂直滑动的手风琴效果
今天我们要与大家分享一个漂亮而灵活的垂直 jQuery 手风琴效果.其主要思想是扩大手风琴片上的点击和显示更多的信息.其他内容片段将变得不那么透明.当使用一个导航箭头导航下一个片段,新的片会从顶部或底 ...
- jquery左右滑动效果的实现
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- Android(java)学习笔记2:继承Thread类创建线程类
1. 继承Thread类 创建线程类: package cn.itcast_02; /* * 该类要重写run()方法,为什么呢? * 不是类中的所有代码都需要被线程执行的. * 而这个时候,为了区分 ...
- 从零开始Vue项目实战(三)-项目结构
目录结构 ├── README.md 项目介绍 ├── index.html 入口页面 ├── build 构建脚本目录 │ ├── build-server.js 运行本地构建服务器,可以访问构建后 ...
- ACM-ICPC(10/21)
写一发后缀数组套路题,看起来简单,写起来要人命哦~~~ 总共13题. 分两天debug吧,有点累了~~~ suffix(后缀数组的应用) sa[i] :排名第 i 的后缀在哪(i 从 1 开始) ra ...
- ACM-ICPC 2018 徐州赛区网络预赛 G. Trace【树状数组维护区间最大值】
任意门:https://nanti.jisuanke.com/t/31459 There's a beach in the first quadrant. And from time to time, ...
- ASP.NET整体运行机制+asp.net请求管道+页面生命周期
- 【luogu P1972 [SDOI2009]HH的项链】 题解
题目链接:https://www.luogu.org/problemnew/show/P1972 真是不懂为什么要卡莫队! #include <cmath> #include <cs ...
- 【题解】洛谷P1006传纸条
链接 https://www.luogu.org/problemnew/show/P1006 日常牢骚 过年前最后一节课上完了坐标DP 也接触了一点区间DP(noi1995石子合并)下次做做看看吧 老 ...
- NDK下载地址
官方下载地址 http://developer.android.com/ndk/downloads/index.html 没有提供旧版下载链接,只能修改链接方式下载 http://dl.google. ...
- java遍历文件夹两种方式
1:非递归方式(有点类似二叉树的非递归遍历,采用链表来存储遍历到的文件夹,如果是文件就直接输出) public void traverseFile(String path){ File[] files ...
- SpringBoot非官方教程 | 第一篇:构建第一个SpringBoot工程
转载请标明出处: https://www.fangzhipeng.com/springboot/2017/07/11/springboot1 本文出自方志朋的博客 简介 spring boot 它的设 ...