這篇文章將為大家詳細(xì)講解有關(guān)js如何實(shí)現(xiàn)產(chǎn)品縮略圖效果,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
成都創(chuàng)新互聯(lián)成立于2013年,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都做網(wǎng)站、成都網(wǎng)站建設(shè)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢想脫穎而出為使命,1280元永德做網(wǎng)站,已為上家服務(wù),為永德各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:18982081108
效果圖:

代碼如下:
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://how2j.cn/study/css/bootstrap/3.3.6/bootstrap.min.css" rel="external nofollow" rel="stylesheet">
<script src="http://how2j.cn/study/js/bootstrap/3.3.6/bootstrap.min.js"></script>
</head>
<script>
$(function(){
$("img.smallImage").mouseenter(function(){
var bigImageURL = $(this).attr("bigImageURL");
$("img.bigImg").attr("src",bigImageURL);
});
$("img.bigImg").load(
function(){
$("img.smallImage").each(function(){
var bigImageURL = $(this).attr("bigImageURL");
img = new Image();
img.src = bigImageURL;
img.onload = function(){
console.log(bigImageURL);
$("div.img4load").append($(img));
};
});
}
);
});
</script>
<style>
div.imgAndInfo{
margin: 40px 20px;
}
div.imgInimgAndInfo{
width: 400px;
float: left;
}
div.imgAndInfo img.bigImg{
width: 400px;
height: 400px;
padding: 20px;
border: 1px solid #F2F2F2;
}
div.imgAndInfo div.smallImageDiv{
width: 80%;
margin: 20px auto;
}
div.imgAndInfo img.smallImage{
width: 60px;
height: 60px;
border: 2px solid white;
}
div.imgAndInfo img.smallImage:hover{
border: 2px solid black;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="imgAndInfo">
<div class="imgInimgAndInfo">
<img width="100px" class="bigImg" src="http://how2j.cn/tmall/img/productSingle/8619.jpg">
<div class="smallImageDiv">
<img width="100px" class="smallImage" src="/upload/otherpic64/8620.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8620.jpg">
<img width="100px" class="smallImage" src="/upload/otherpic64/8619.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8619.jpg">
<img width="100px" class="smallImage" src="/upload/otherpic64/8618.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8618.jpg">
<img width="100px" class="smallImage" src="/upload/otherpic64/8617.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8617.jpg">
<img width="100px" class="smallImage" src="/upload/otherpic64/8616.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8616.jpg">
</div>
<div class="img4load hidden" ></div>
</div>
<div ></div>
</div>關(guān)于“js如何實(shí)現(xiàn)產(chǎn)品縮略圖效果”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學(xué)到更多知識,如果覺得文章不錯(cuò),請把它分享出去讓更多的人看到。
當(dāng)前題目:js如何實(shí)現(xiàn)產(chǎn)品縮略圖效果
本文路徑:http://chinadenli.net/article34/jggope.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供手機(jī)網(wǎng)站建設(shè)、用戶體驗(yàn)、外貿(mào)建站、微信公眾號、網(wǎng)頁設(shè)計(jì)公司、建站公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)