QQ商城點擊左右滾動jquery焦點圖特效是不是很炫酷呢?你知道是怎么實現的嗎?不知道的話跟著搜小知識小編一起來學習實現QQ商城點擊左右滾動jquery焦點圖特效 。
實現QQ商城點擊左右滾動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=gb2312" />
<style type="text/css">
body {font-size:12px; color:#222; font-family:Verdana,Arial,Helvetica,sans-serif; background:#f0f0f0;}
ul,li {list-style:none; margin:0px; padding:0px;}
img {border:0;}
/* 仿QQ商城點擊左右滾動jquery焦點圖特效插件 */
.focus {width:800px; height:280px; overflow:hidden; position:relative;}
.focus ul {height:380px; position:absolute;}
.focus ul li {float:left; width:800px; height:280px; overflow:hidden; position:relative; background:#000;}
.focus ul li div {position:absolute; overflow:hidden;}
.focus .btnBg {position:absolute; width:800px; height:20px; left:0; bottom:0; background:#000; display:none;}
.focus .btn {position:absolute; width:780px; height:23px; padding:0px 10px 0px 10px; right:0; bottom:6px; text-align:right;}
.focus .btn span {display:inline-block; _display:inline; _zoom:1; width:25px; height:24px; line-height:24px; text-align:center; _font-size:0; margin-left:5px; cursor:pointer; background:#fff;}
.focus .btn span.on {background:#fff;}
.focus .preNext {width:45px; height:100px; position:absolute; top:90px; background:url(img/sprite.png) no-repeat 0 0; cursor:pointer;}
.focus .pre {left:0;}
.focus .next {right:0; background-position:right top;}
</style>
<script type="text/javascript" src=https://www.soxzs.com/wlkj/dncs/"js/jquery.min.js">
<script type="text/javascript" src=https://www.soxzs.com/wlkj/dncs/"js/sl.js">
<script type="text/javascript">
$(document).ready(function(){
$.focus("#focus001");
$.focus("#focus002");
});
</script>
</head>
<body>
<h1></h1>
<div class="focus" id="focus001">
【js實現點擊左右滾動jquery焦點圖特效】<ul>
<li><a href=https://www.soxzs.com/wlkj/dncs/"http://www.51xuediannao.com/" target="_blank">
<li><a href=https://www.soxzs.com/wlkj/dncs/"http://www.51xuediannao.com/" target="_blank">
<li><a href=https://www.soxzs.com/wlkj/dncs/"http://www.51xuediannao.com/" target="_blank">
</ul>
</div>
<p>修改的幾個地方:1、隱藏了半透明背景條,2、把那個小常條滑塊讀出了1234這些數字 。你不喜歡這樣你可以修改樣式和自己改動下jquery代碼 。</p>
<p>調用方法:很簡單,$.focus("#focus001"); 一些參數設置,可以修改js中的設置,源作者已經注釋的很清楚了 。</p>
</body>
</html>
JS
$(function() {
jQuery.focus = function(slid) {
var sWidth = $(slid).width(); //獲取焦點圖的寬度(顯示面積)
var len = $(slid).find("ul li").length; //獲取焦點圖個數
var index = 0;
var picTimer;
//以下代碼添加數字按鈕和按鈕后的半透明條,還有上一頁、
- 抖音最火語錄勵志30字左右
- 左和右的英文字母 左右的左的英文字母是什么
- 鉞怎么讀
- 三觀不合的人,到底有多累?
- 累了,就來這里說說吧
- 熬住,你就贏了
- 懂因果的人,不會占便宜。
- 如何建立局域網共享:兩臺電腦或多臺電腦應該如何實現共享?
- 廣州荔枝價格表今日價格,廣州今日豬價
- 愛自己,我又做錯了什么呢?
