简洁的左右切换焦点图代码jQuery轮播滚动切换特效

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

以下是 简洁的左右切换焦点图代码jQuery轮播滚动切换特效 的示例演示效果:

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

部分效果截图:

简洁的左右切换焦点图代码jQuery轮播滚动切换特效

HTML代码(index.html):

<!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=gb2312" />
    <meta name="keywords" content="JS代码,焦点图,JS广告代码,JS特效代码" />
    <meta name="description" content="此代码内容为简洁的左右切换焦点图代码(jQuery)" />
    <title>简洁的左右切换焦点图代码(jQuery)</title>
    <link href="css/simplefoucs_lrtk.css" rel="stylesheet" />
    <script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="js/simplefoucs.js" type="text/javascript"></script>
</head>
<body>
<!-- 代码 开始 -->
<div class="bannerbox">
    <div id="focus">
        <ul>
            <li><a href="#" target="_blank">
                <img src="images/bn1.jpg" alt="" /></a></li>
            <li><a href="#" target="_blank">
                <img src="images/bn2.jpg" alt="" /></a></li>
            <li><a href="#" target="_blank">
                <img src="images/bn3.jpg" alt="" /></a></li>
            <li><a href="#" target="_blank">
                <img src="images/bn4.jpg" alt="" /></a></li>
        </ul>
    </div>
</div>
</body>
</html>

JS代码(simplefoucs.js):

$(function (){
	var sWidth = $("#focus").width();
	var len = $("#focus ul li").length;
	var index = 0;
	var picTimer;
	var btn = "<div class='btnBg'></div><div class='btn'>";
	for (var i = 0;
	i < len;
	i++){
	btn += "<span></span>";
}
btn += "</div><div class='preNext pre'></div><div class='preNext next'></div>";
	$("#focus").append(btn);
	$("#focus .btnBg").css("opacity",0);
	$("#focus .btn span").css("opacity",0.4).mouseenter(function (){
	index = $("#focus .btn span").index(this);
	showPics(index);
}
).eq(0).trigger("mouseenter");
	$("#focus .preNext").css("opacity",0.0).hover(function (){
	$(this).stop(true,false).animate({
	"opacity":"0.5"}
,300);
}
,function (){
	$(this).stop(true,false).animate({
	"opacity":"0"}
,300);
}
);
	$("#focus .pre").click(function (){
	index -= 1;
	if (index == -1){
	index = len - 1;
}
showPics(index);
}
);
	$("#focus .next").click(function (){
	index += 1;
	if (index == len){
	index = 0;
}
showPics(index);
}
);
	$("#focus ul").css("width",sWidth * (len));
	$("#focus").hover(function (){
	clearInterval(picTimer);
}
,function (){
	picTimer = setInterval(function (){
	showPics(index);
	index++;
	if (index == len){
	index = 0;
}
}
,2800);
}
).trigger("mouseleave");
	function showPics(index){
	var nowLeft = -index * sWidth;
	$("#focus ul").stop(true,false).animate({
	"left":nowLeft}
,300);
	$("#focus .btn span").stop(true,false).animate({
	"opacity":"0.4"}
,300).eq(index).stop(true,false).animate({
	"opacity":"1"}
,300);
}
}
);
	

CSS代码(simplefoucs_lrtk.css):

@charset "utf-8";img{border:0px;}
.bannerbox{width:1172px;height:447px;overflow:hidden;margin:0px auto;}
#focus{width:1172px;height:447px;clear:both;overflow:hidden;position:relative;float:left;}
#focus ul{width:1172px;height:447px;float:left;position:absolute;clear:both;padding:0px;margin:0px;}
#focus ul li{float:left;width:1172px;height:447px;overflow:hidden;position:relative;padding:0px;margin:0px;}
#focus .preNext{width:550px;height:447px;position:absolute;top:0px;cursor:pointer;}
#focus .pre{left:0;background:url(../images/sprite.png) no-repeat left center;}
#focus .next{right:0;background:url(../images/sprite1.png) no-repeat right center;}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
519.57 KB
Html 焦点滚动特效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
打赏文章