适合手机页面微信页面pc页面用的幻灯片
来源:互联网 发布:java编写计算器源代码 编辑:程序博客网 时间:2024/04/29 22:54
适合手机页面、微信网页的幻灯图插件
首先是css文件 style.css
@charset "utf-8";*{margin:0;padding:0;list-style:none;border:0;}body{width:100%;margin:0 auto;overflow:hidden}/* main_image */.main_visual{height:422px;border-top:1px solid #d7d7d7;overflow:hidden;position:relative;}.main_image{height:422px;overflow:hidden;position:relative;}.main_image ul{width:9999px;height:422px;overflow:hidden;position:absolute;top:0;left:0}.main_image li{float:left;width:100%;height:422px;}.main_image li span{display:block;width:100%;height:422px}.main_image li a{display:block;width:100%;height:422px}.main_image li .img_1{background:url('../images/img_main_1.jpg') center top no-repeat}.main_image li .img_2{background:url('../images/img_main_2.jpg') center top no-repeat}.main_image li .img_3{background:url('../images/img_main_3.jpg') center top no-repeat}.main_image li .img_4{background:url('../images/img_main_4.jpg') center top no-repeat}.main_image li .img_5{background:url('../images/img_main_5.jpg') center top no-repeat}div.flicking_con{position:absolute;top:360px;left:50%;z-index:999;width:300px;height:21px;margin:0 0 0 -50px;}div.flicking_con a{float:left;width:21px;height:21px;margin:0;padding:0;background:url('../images/btn_main_img.png') 0 0 no-repeat;display:block;text-indent:-1000px}div.flicking_con a.on{background-position:0 -21px}#btn_prev,#btn_next{z-index:11111;position:absolute;display:block;width:73px!important;height:74px!important;top:50%;margin-top:-37px;display:none;}#btn_prev{background:url(../images/hover_left.png) no-repeat left top;left:100px;}#btn_next{background:url(../images/hover_right.png) no-repeat right top;right:100px;}
接下来呈上页面及jquery
<!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" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><title>jQuery touchSlider插件</title><link type="text/css" href="css/style.css" rel="stylesheet"/><script type="text/javascript" src="js/jquery-1.7.1.min.js"></script><script type="text/javascript" src="js/jquery.event.drag-1.5.min.js"></script><script type="text/javascript" src="js/jquery.touchSlider.js"></script><script type="text/javascript">$(document).ready(function(){$(".main_visual").hover(function(){$("#btn_prev,#btn_next").fadeIn()},function(){$("#btn_prev,#btn_next").fadeOut()});$dragBln = false;$(".main_image").touchSlider({flexible : true,speed : 200,btn_prev : $("#btn_prev"),btn_next : $("#btn_next"),paging : $(".flicking_con a"),counter : function (e){$(".flicking_con a").removeClass("on").eq(e.current-1).addClass("on");}});$(".main_image").bind("mousedown", function() {$dragBln = false;});$(".main_image").bind("dragstart", function() {$dragBln = true;});$(".main_image a").click(function(){if($dragBln) {return false;}});timer = setInterval(function(){$("#btn_next").click();}, 5000);$(".main_visual").hover(function(){clearInterval(timer);},function(){timer = setInterval(function(){$("#btn_next").click();},5000);});$(".main_image").bind("touchstart",function(){clearInterval(timer);}).bind("touchend", function(){timer = setInterval(function(){$("#btn_next").click();}, 5000);});});</script></head><body><div class="main_visual"><div class="flicking_con"><a href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#">4</a><a href="#">5</a></div><div class="main_image"><ul><li><span class="img_3"></span></li><li><span class="img_4"></span></li><li><span class="img_1"></span></li><li><span class="img_2"></span></li><li><span class="img_5"></span></li></ul><a href="javascript:;" id="btn_prev"></a><a href="javascript:;" id="btn_next"></a></div></div><!--main_visual end--></body></html>
代码如下:
0 0
- 适合手机页面微信页面pc页面用的幻灯片
- 绕过限制,在PC上调试微信手机页面
- 微信、手机页面禁止页面下拉
- 【模态窗】制作适合手机页面的模态弹窗
- pc 调试手机页面的方法
- 在PC上打开微信页面
- pc调试微信h5页面
- 突破限制 在PC上调试微信手机页面 微信网站
- pc端页面转成手机端页面
- html中的js获取当前的页面是位于哪个容器中打开(pc,手机,微信...)
- 如何突破限制,在PC上调试微信手机页面
- 如何突破限制,在PC上调试微信手机页面
- 手机微信页面怎么查看源码
- 移动WEB——适合手机浏览的HTML页面
- 识别pc和手机版跳转不同的页面
- 使用手机查看pc本地服务器的页面
- PC端查看手机端页面
- PC、手机web页面直播hls视频
- Jenkins中Git及log中文乱码问题
- 用 WEKA 进行数据挖掘,第 3 部分: 最近邻和服务器端库
- 纠结原创?那就COPY吧!
- servlet获得网站路径
- FireFox模拟IPad或者IPhone效果
- 适合手机页面微信页面pc页面用的幻灯片
- Android开发 布局优化
- Linux gcc/g++编译器使用
- SQL Server资料整理
- Oracle I/O问题解析
- APC注入
- 联想Z470安装OSX10.11并成功驱动显卡、声卡、网卡
- tfyuiijo
- lintcode--爬台阶