jQuery滚动切换选项卡特效插件特效代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 jQuery滚动切换选项卡特效插件特效代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

jQuery滚动切换选项卡特效插件特效代码

HTML代码(index.html):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Tabbed jQuery slideshow</title>
<link rel="stylesheet" href="css/slideshow.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.cycle.js"></script>
<script type="text/javascript" src="js/slideshow.js"></script>
</head>
<body>
<div id="slideshow">
  <div class="slides">
    <ul>
      <li id="slide-one">
        <h2>Slide one</h2>
        <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
          Donec pretium arcu non velit. Phasellus adipiscing auctor 
          lorem. Curabitur in urna ut purus consequat sollicitudin. 
          Phasellus ut diam. Cras magna libero, tempor id, venenatis 
          sit amet, venenatis et, dui. </p>
      </li>
      <li id="slide-two">
        <h2>Slide two</h2>
        <p> Nam ac nibh sit amet augue ultricies sagittis. Donec sit 
          amet nunc. Vivamus lacinia, nisi ac tincidunt commodo, purus 
          nisi condimentum urna, sit amet molestie odio dolor non lectus. 
          Cum sociis natoque penatibus et magnis dis parturient montes, 
          nascetur ridiculus mus. </p>
      </li>
      <li id="slide-three">
        <h2>Slide three</h2>
        <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
          Suspendisse adipiscing dui a nibh. Integer tristique lorem 
          vitae massa. Etiam dapibus, eros sit amet euismod semper, 
          felis erat congue lacus, sed aliquam metus libero sed elit. </p>
      </li>
    </ul>
  </div>
  <ul class="slides-nav">
    <li class="on"><a href="#slide-one">Slide one</a></li>
    <li><a href="#slide-two">Slide two</a></li>
    <li><a href="#slide-three">Slide three</a></li>
  </ul>
</div>
</body>
</html>







JS代码(slideshow.js):

$slideshow ={
	context:false,tabs:false,timeout:1000,// time before next slide appears (in ms) slideSpeed:1000,// time it takes to slide in each slide (in ms) tabSpeed:300,// time it takes to slide in each slide (in ms) when clicking through tabs fx:'scrollLeft',// the slide effect to use init:function(){
	// set the context to help speed up selectors/improve performance this.context = $('#slideshow');
	// set tabs to current hard coded navigation items this.tabs = $('ul.slides-nav li',this.context);
	// remove hard coded navigation items from DOM // because they aren't hooked up to jQuery cycle this.tabs.remove();
	// prepare slideshow and jQuery cycle tabs this.prepareSlideshow();
}
,prepareSlideshow:function(){
	// initialise the jquery cycle plugin - // for information on the options set below go to:// http://malsup.com/jquery/cycle/options.html $('div.slides > ul',$slideshow.context).cycle({
	fx:$slideshow.fx,timeout:$slideshow.timeout,speed:$slideshow.slideSpeed,fastOnEvent:$slideshow.tabSpeed,pager:$('ul.slides-nav',$slideshow.context),pagerAnchorBuilder:$slideshow.prepareTabs,before:$slideshow.activateTab,pauseOnPagerHover:true,pause:true}
);
}
,prepareTabs:function(i,slide){
	// return markup from hardcoded tabs for use as jQuery cycle tabs // (attaches necessary jQuery cycle events to tabs) return $slideshow.tabs.eq(i);
}
,activateTab:function(currentSlide,nextSlide){
	// get the active tab var activeTab = $('a[href="#' + nextSlide.id + '"]',$slideshow.context);
	// if there is an active tab if(activeTab.length){
	// remove active styling from all other tabs $slideshow.tabs.removeClass('on');
	// add active styling to active button activeTab.parent().addClass('on');
}
}
}
;
	$(function(){
	// add a 'js' class to the body $('body').addClass('js');
	// initialise the slideshow when the DOM is ready $slideshow.init();
}
);
	

CSS代码(slideshow.css):

/* ---------------------------------------------------- */
/* GLOBAL/* ---------------------------------------------------- */
html{font-size:76%;}
body{font-family:arial,helvetica,sans-serif;line-height:1.4em;font-size:1.2em;padding:5%;}
/* ---------------------------------------------------- */
/* SLIDESHOW/* ---------------------------------------------------- */
#slideshow{width:960px;background-color:#eee;border:1px solid #ddd;}
#slideshow ul{margin:0;padding:0;list-style-type:none;height:1%;/* IE fix */
}
#slideshow ul:after{content:".";clear:both;display:block;height:0;visibility:hidden;}
/* ---------------------------------------------------- */
/* SLIDESHOW > SLIDES/* ---------------------------------------------------- */
#slideshow .slides{overflow:hidden;width:960px;}
#slideshow .slides ul{width:2880px;}
#slideshow .slides li{width:920px;float:left;padding:20px;}
#slideshow .slides h2{margin-top:0;}
/* ---------------------------------------------------- */
/* SLIDESHOW > NAVIGATION/* ---------------------------------------------------- */
#slideshow .slides-nav{background-color:#ddd;border-top:2px solid #ccc;}
#slideshow .slides-nav li{float:left;}
#slideshow .slides-nav li a{display:block;padding:15px 20px;outline:none;}
.js #slideshow .slides-nav li.on,.js #slideshow .slides-nav li.on a{background-color:#eee;}
.js #slideshow .slides-nav li.on a{position:relative;top:-4px;}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
39.82 KB
Html Js 菜单导航特效3
最新结算
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
HTML5实现CSS滤镜图片切换特效代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery+css3实现信封效果
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章