博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
自适应通栏焦点图
阅读量:7220 次
发布时间:2019-06-29

本文共 2755 字,大约阅读时间需要 9 分钟。

1、结构

<!-------------------------------焦点图通栏自适应---------------------------->

<div class="fullSlide">
      <div class="bd">
        <ul>
          <li _src="url(images/banner1.jpg)" style="background:#fff center 0 no-repeat;"><a href="http://www.internetke.com/effects/css3/2015/0116/1193.html" target="_blank"></a></li>
          <li _src="url(images/banner2.jpg)" style="background:#fff center 0 no-repeat;"><a href="http://www.internetke.com/effects/css3/2015/0116/1193.html" target="_blank"></a></li>
          <li _src="url(images/banner3.jpg)" style="background:#fff center 0 no-repeat;"><a href="http://www.internetke.com/effects/css3/2015/0116/1193.html" target="_blank"></a></li>
          <li _src="url(images/banner4.jpg)" style="background:#fff center 0 no-repeat;"><a href="http://wpa.qq.com/msgrd?v=3&amp;uin=283673468&amp;site=QQ咨询&amp;menu=yes" target="_blank"></a></li>
          
        </ul>
      </div>
      <div class="hd">
        <ul>
        </ul>
      </div>
  <span class="prev"></span> <span class="next"></span>
</div>

 

2、样式

 

/*banner焦点图*/

.fullSlide {width:100%;position:relative;height:500px;background:#fff;}
.fullSlide .bd {margin:0 auto;position:relative;z-index:0;overflow:hidden;}
.fullSlide .bd ul {width:100% !important;}
.fullSlide .bd li {width:100% !important;height:500px;overflow:hidden;text-align:center;}
.fullSlide .bd li a {display:block;height:500px;}
.fullSlide .hd {width:100%;position:absolute;z-index:1;bottom:0;left:0;height:30px;line-height:30px;}
.fullSlide .hd ul {text-align:center;}
.fullSlide .hd ul li {cursor:pointer;display:inline-block;*display:inline;zoom:1;width:42px;height:11px;margin:1px;overflow:hidden;background:#000;filter:alpha(opacity=50);opacity:0.5;line-height:999px;}
.fullSlide .hd ul .on {background:#f00;}
.fullSlide .prev,.fullSlide .next {display:block;position:absolute;z-index:1;top:50%;margin-top:-30px;left:15%;z-index:1;width:40px;height:60px;background:url(../images/slider-arrow.png) -126px -137px #000 no-repeat;cursor:pointer;filter:alpha(opacity=50);opacity:0.5;display:none;}
.fullSlide .next {left:auto;right:15%;background-position:-6px -137px;}

3、效果

<!-------------------------------焦点图---------------------------->

<script src=""></script>

<script src="">

</script> <script src=""></script>

<script type="text/javascript">
jQuery(".fullSlide").hover(function() {
    jQuery(this).find(".prev,.next").stop(true, true).fadeTo("show", 0.5)
},
function() {
    jQuery(this).find(".prev,.next").fadeOut()
});
jQuery(".fullSlide").slide({
    titCell: ".hd ul",
    mainCell: ".bd ul",
    effect: "fold",
    autoPlay: true,
    autoPage: true,
    trigger: "click",
    startFun: function(i) {
        var curLi = jQuery(".fullSlide .bd li").eq(i);
        if ( !! curLi.attr("_src")) {
            curLi.css("background-image", curLi.attr("_src")).removeAttr("_src")
        }
    }
});
</script>

 

转载于:https://www.cnblogs.com/su1637/p/8178234.html

你可能感兴趣的文章
Newtonsoft 自定义输出内容
查看>>
HTML图片元素(标记)
查看>>
windows server 2008 域控安装
查看>>
编写高质量代码:改善Java程序的151个建议(第1章:JAVA开发中通用的方法和准则___建议6~10)...
查看>>
Oracle查看和修改连接数(进程/会话/并发等等)
查看>>
【SpringMVC学习06】SpringMVC中的数据校验
查看>>
Laravel错误与日志处理
查看>>
微信小程序开发教程第七章:微信小程序编辑名片页面开发
查看>>
Java并发编程:Java ConcurrentModificationException异常原因和解决方法
查看>>
浅谈iOS中MVVM的架构设计
查看>>
node.js 中模块的循环调用问题详解
查看>>
ActiveReports 报表应用教程 (6)---分组报表
查看>>
OLEDB操作Excel
查看>>
struts2的json-default和struts-default的区别
查看>>
java中<> 的用法
查看>>
IIS 下配置无后缀的URL ReWrite
查看>>
对Asp.net Mvc 和 jQuery UI使用者的一些忠告
查看>>
Silverlight开发历程—动画(实现跑马灯效果)
查看>>
怎么说???
查看>>
[原]Windows批处理命令学习一
查看>>