banner图幻灯片通屏显示效果

  <!--banner开始-->
<style type="text/css">

  /* 本例子css */
  .fullSlide{ width:100%;  position:relative;  height:400px; background:#F7F6F6;  }
  .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:400px; overflow:hidden; text-align:center;  }
  .fullSlide .bd li a{ display:block; height:400px; }

  .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:#f3af2d;  }

</style>

  <div class="fullSlide">
    
    <div class="bd">
      <ul>
        
      {aspcms:slidelist id=1}     
        <li _src="url([slidelist:pic])" style="background:#F7F6F6 center 0 no-repeat;"><a target="_blank" href="[slidelist:link]"></a></li>
        {/aspcms:slidelist}
        
      </ul>
    </div>

    <div class="hd"><ul></ul></div>
  </div>
<script type="text/javascript" src="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/images/jquery1.42.min.js"></script>
<script type="text/javascript" src="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/images/jquery.SuperSlide.2.1.1.js"></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() });

    /* 调用SuperSlide */
    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); /* 当前大图的li */
        if( !!curLi.attr("_src") ){
          curLi.css("background-image",curLi.attr("_src")).removeAttr("_src") /* 将_src地址赋予li背景,然后删除_src */
        }
      }
    });
  </script>

<!--banner结束-->

 



banner特效用到了两个JS文件

jquery1.42.min.js

jquery.SuperSlide.2.1.1.js

这两个文件我已存到我百度网盘

幻灯片高度为400是可以随时改动的




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
实现全屏轮播的banner,可以采用以下步骤: 1. 设置轮播容器的宽高为100%,即占据整个屏幕的宽高。 2. 将轮播容器内的片都设置为宽高100%。 3. 使用JavaScript或jQuery编写轮播功能代码,实现片自动切换和手动切换的效果。 4. 可以使用CSS3的transition属性和transform属性,实现片切换时的动画效果。 以下是一个简单的实现全屏轮播的banner的示例代码: HTML代码: ```html <div class="banner"> <img src="img/banner1.jpg" alt=""> <img src="img/banner2.jpg" alt=""> <img src="img/banner3.jpg" alt=""> </div> ``` CSS代码: ```css .banner { width: 100%; height: 100vh; overflow: hidden; position: relative; } .banner img { width: 100%; height: 100%; position: absolute; top: 0; left: 0; opacity: 0; transition: opacity .5s ease-in-out; } .banner img.active { opacity: 1; } ``` JavaScript代码: ```javascript $(function() { var $banner = $('.banner'); var $imgs = $banner.find('img'); var index = 0; var len = $imgs.length; // 初始化第一张片 $imgs.eq(0).addClass('active'); // 自动切换片 setInterval(function() { index++; if (index >= len) { index = 0; } $imgs.removeClass('active'); $imgs.eq(index).addClass('active'); }, 3000); // 手动切换片 $banner.on('click', function() { index++; if (index >= len) { index = 0; } $imgs.removeClass('active'); $imgs.eq(index).addClass('active'); }); }); ``` 以上代码中,使用jQuery实现了轮播功能,每隔3秒自动切换片,同时也可以点击片手动切换。CSS3的transition和transform属性实现了片切换时的渐变动画效果

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值