欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js實(shí)現(xiàn)產(chǎn)品縮略圖效果

 更新時(shí)間:2017年03月10日 11:25:53   作者:gsc756374668ts  
本文主要介紹了js實(shí)現(xiàn)產(chǎn)品縮略圖效果的實(shí)例。具有很好的參考價(jià)值。下面跟著小編一起來(lái)看下吧

效果圖:

代碼如下:

<!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  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="http://how2j.cn/tmall/img/productSingle_small/8620.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8620.jpg">
    <img width="100px" class="smallImage" src="http://how2j.cn/tmall/img/productSingle_small/8619.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8619.jpg">
    <img width="100px" class="smallImage" src="http://how2j.cn/tmall/img/productSingle_small/8618.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8618.jpg">
    <img width="100px" class="smallImage" src="http://how2j.cn/tmall/img/productSingle_small/8617.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8617.jpg">
    <img width="100px" class="smallImage" src="http://how2j.cn/tmall/img/productSingle_small/8616.jpg" bigImageURL="http://how2j.cn/tmall/img/productSingle/8616.jpg">
  </div>
 <div class="img4load hidden" ></div>  
 </div>
 <div style="clear:both"></div>
</div>

以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,同時(shí)也希望多多支持腳本之家!

相關(guān)文章

  • 解讀CocosCreator源碼之引擎啟動(dòng)與主循環(huán)

    解讀CocosCreator源碼之引擎啟動(dòng)與主循環(huán)

    這篇文章主要介紹了CocosCreator源碼解讀之引擎啟動(dòng)與主循環(huán),對(duì)CocosCreator感興趣的同學(xué),可以研究參考一下
    2021-04-04
  • 使用apifm-wxapi模塊中的問(wèn)題及解決方法

    使用apifm-wxapi模塊中的問(wèn)題及解決方法

    這篇文章主要介紹了使用apifm-wxapi模塊中的問(wèn)題及講解決,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-08-08
  • javascript中一些util方法匯總

    javascript中一些util方法匯總

    Util.js文件包含了一些工具函數(shù),來(lái)幫助人們使用JavaScript數(shù)據(jù)(例如從服務(wù)器返回的數(shù)據(jù))來(lái)更新Web頁(yè)面。有需要的小伙伴可以參考下
    2015-06-06
  • 用于deeplink的js方法(判斷手機(jī)是否安裝app)

    用于deeplink的js方法(判斷手機(jī)是否安裝app)

    這篇文章主要介紹了用于deeplink的js方法(判斷手機(jī)是否安裝app),需要的朋友可以參考下
    2014-04-04
  • 用Node.js通過(guò)sitemap.xml批量抓取美女圖片

    用Node.js通過(guò)sitemap.xml批量抓取美女圖片

    這篇文章主要介紹了用Node.js通過(guò)sitemap.xml批量抓取美女圖片的方法和相關(guān)代碼,有需要的小伙伴可以參考下。
    2015-05-05
  • javascript 變量作用域 代碼分析

    javascript 變量作用域 代碼分析

    作用域(scope)是javascript中一項(xiàng)令人棘手的的特性。所有面向?qū)ο缶幊陶Z(yǔ)言都有某種形式的作用域,不過(guò)和把這個(gè)概念放在什么上下文中有關(guān)。在javascript里,作用域是由函數(shù)劃分的。
    2009-06-06
  • Mock.js的安裝與使用教程(擺脫后端同學(xué)的束縛)

    Mock.js的安裝與使用教程(擺脫后端同學(xué)的束縛)

    Mock功能可以根據(jù)接口/數(shù)據(jù)結(jié)構(gòu)定義、Mock規(guī)則配置、Mock?期望配置,自動(dòng)生成模擬數(shù)據(jù),且使用者可以根據(jù)需要靈活構(gòu)造各種結(jié)構(gòu)的接口數(shù)據(jù),下面這篇文章主要給大家介紹了關(guān)于Mock.js的安裝與使用的相關(guān)資料,需要的朋友可以參考下
    2022-08-08
  • Javascript實(shí)現(xiàn)仿WebQQ界面的“浮云”兼容 IE7以上版本及FF

    Javascript實(shí)現(xiàn)仿WebQQ界面的“浮云”兼容 IE7以上版本及FF

    兼容:IE7以上版本及FF;(騰訊的WebQQ3.0好像也不兼容IE6,其實(shí)這樣挺好的)
    2011-04-04
  • bootstrap自定義樣式之bootstrap實(shí)現(xiàn)側(cè)邊導(dǎo)航欄功能

    bootstrap自定義樣式之bootstrap實(shí)現(xiàn)側(cè)邊導(dǎo)航欄功能

    bootstrap自帶的響應(yīng)式導(dǎo)航欄是向下滑動(dòng)的,有時(shí)滿足不了個(gè)性化的需求,需要做一個(gè)類似于android drawerLayout 側(cè)滑的菜單,這就是我要實(shí)現(xiàn)的bootstrap自定義側(cè)滑菜單。接下來(lái)通過(guò)本文給大家介紹bootstrap實(shí)現(xiàn)側(cè)邊導(dǎo)航欄功能,感興趣的朋友一起看看吧
    2018-09-09
  • JS關(guān)于刷新頁(yè)面的相關(guān)總結(jié)

    JS關(guān)于刷新頁(yè)面的相關(guān)總結(jié)

    在本篇內(nèi)容中我們給大家整理了關(guān)于JS刷新頁(yè)面的所有相關(guān)知識(shí)點(diǎn)以及整理了相關(guān)的技術(shù)文章,大家可以收藏本頁(yè)面繼續(xù)深入學(xué)習(xí)。
    2018-05-05

最新評(píng)論