jQuery簡易圖片放大特效示例代碼
更新時間:2014年06月09日 11:23:34 作者:
這篇文章主要介紹了通過jQuery實(shí)現(xiàn)的簡易圖片放大特效,需要的朋友可以參考下
DEMO點(diǎn)擊圓形圖片,圖片方法,將水的圖片放置與下層,鼠標(biāo)移上去的時候,圖片高與寬同比增大,并且圖片向左上移動
代碼
<!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=utf-8" />
<title>無標(biāo)題文檔</title>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(e) {
$(".water1").mouseover(function(){
$("#img1").stop(true,true).animate({top:"-32.5px",left:"-32.5px", width:"400px",height:"400px"},"slow");
$("#img2").stop(true,true).animate({top:"-10px",left:"-10px", width:"115px",height:"115px"},"slow");
$("#img3").stop(true,true).animate({top:"-4px",left:"-4px", width:"41px",height:"41px"},"slow");
})
$(".water1").mouseout(function(){
$("#img1").stop(true,true).animate({top:"0px",left:"0px",width:"335px",height:"335px"},"slow");
$("#img2").stop(true,true).animate({top:"0px",left:"0px", width:"95px",height:"95px"},"slow");
$("#img3").stop(true,true).animate({top:"0px",left:"0px", width:"33px",height:"33px"},"slow");
})
});
</script>
<style>
.show{ width:1440px; height:474px; position:relative; background-color:#3d9abc;}
.water1{ height: 335px; width:335px; border-radius:167.5px; overflow:hidden; position:absolute; left:186px; top:69px;}
.water2{ height: 95px; width:95px; border-radius:47.5px; overflow:hidden; position:absolute; left:545px; top:294px;}
.water3{ height: 33px; width:33px; border-radius:16.5px; overflow:hidden; position:absolute; left:549px; top:220px;}
#img1{ position:absolute;}
#img2{ position:absolute; }
#img3{ position:absolute;}
</style>
</head>
<body>
<div class="show">
<div class="water1"><img id="img1" src="images/big.jpg" /></div>
<div class="water2"><img id="img2" src="images/middle.jpg" /></div>
<div class="water3"><img id="img3" src="images/small.jpg" /></div>
</div>
</body>
</html>
代碼
復(fù)制代碼 代碼如下:
<!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=utf-8" />
<title>無標(biāo)題文檔</title>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(e) {
$(".water1").mouseover(function(){
$("#img1").stop(true,true).animate({top:"-32.5px",left:"-32.5px", width:"400px",height:"400px"},"slow");
$("#img2").stop(true,true).animate({top:"-10px",left:"-10px", width:"115px",height:"115px"},"slow");
$("#img3").stop(true,true).animate({top:"-4px",left:"-4px", width:"41px",height:"41px"},"slow");
})
$(".water1").mouseout(function(){
$("#img1").stop(true,true).animate({top:"0px",left:"0px",width:"335px",height:"335px"},"slow");
$("#img2").stop(true,true).animate({top:"0px",left:"0px", width:"95px",height:"95px"},"slow");
$("#img3").stop(true,true).animate({top:"0px",left:"0px", width:"33px",height:"33px"},"slow");
})
});
</script>
<style>
.show{ width:1440px; height:474px; position:relative; background-color:#3d9abc;}
.water1{ height: 335px; width:335px; border-radius:167.5px; overflow:hidden; position:absolute; left:186px; top:69px;}
.water2{ height: 95px; width:95px; border-radius:47.5px; overflow:hidden; position:absolute; left:545px; top:294px;}
.water3{ height: 33px; width:33px; border-radius:16.5px; overflow:hidden; position:absolute; left:549px; top:220px;}
#img1{ position:absolute;}
#img2{ position:absolute; }
#img3{ position:absolute;}
</style>
</head>
<body>
<div class="show">
<div class="water1"><img id="img1" src="images/big.jpg" /></div>
<div class="water2"><img id="img2" src="images/middle.jpg" /></div>
<div class="water3"><img id="img3" src="images/small.jpg" /></div>
</div>
</body>
</html>
您可能感興趣的文章:
- jquery 實(shí)現(xiàn)京東商城、凡客商城的圖片放大效果
- jquery 圓形旋轉(zhuǎn)圖片滾動切換效果
- 用JQuery模仿淘寶的圖片放大鏡顯示效果
- 基于Jquery實(shí)現(xiàn)的一個圖片滾動切換
- jQuery+css實(shí)現(xiàn)圖片滾動效果(附源碼)
- jquery圖片放大鏡功能的實(shí)例代碼
- Jquery圖片滾動與幻燈片的實(shí)例代碼
- jQuery bxCarousel實(shí)現(xiàn)圖片滾動切換效果示例代碼
- jQuery圖片滾動圖片的效果(另類實(shí)現(xiàn))
- jquery圖片放大功能簡單實(shí)現(xiàn)
- jQuery實(shí)現(xiàn)圖片放大預(yù)覽實(shí)現(xiàn)原理及代碼
- jquery實(shí)現(xiàn)圖片滾動效果的簡單實(shí)例
- JQuery 圖片滾動輪播示例代碼
- 一個jquery實(shí)現(xiàn)的不錯的多行文字圖片滾動效果
- jquery實(shí)現(xiàn)多行文字圖片滾動效果示例代碼
- jQuery實(shí)現(xiàn)類似淘寶網(wǎng)圖片放大效果的方法
- jquery圖片滾動放大代碼分享(1)
相關(guān)文章
jquery統(tǒng)計(jì)用戶選中的復(fù)選框的個數(shù)
使用選擇器得到所有被勾選的復(fù)選框元素的集合,然后通過判斷元素的個數(shù)來得到用戶勾選的個數(shù),需要的朋友可以參考下2014-06-06jQuery通過ajax請求php遍歷json數(shù)組到table中的代碼(推薦)
這篇文章主要介紹了jQuery通過ajax請求php遍歷json數(shù)組到table中代碼(推薦)的相關(guān)資料,非常不錯具有參考借鑒價值,需要的朋友可以參考下2016-06-06jquery實(shí)現(xiàn)滑屏大圖定時收縮為小banner圖片的廣告代碼
這篇文章主要介紹了jquery實(shí)現(xiàn)滑屏大圖定時收縮為小banner圖片的廣告代碼,可實(shí)現(xiàn)大幅廣告圖的漸顯效果及定時收縮功能,點(diǎn)擊左上角關(guān)閉按鈕還可隱藏廣告圖片,非常具有實(shí)用價值,需要的朋友可以參考下2015-09-09JQuery AJAX實(shí)現(xiàn)目錄瀏覽與編輯的代碼
這部分作為后臺的一部分實(shí)現(xiàn),目的是實(shí)現(xiàn)某個指定目錄下所有文件夾和文件的瀏覽,同時不顯示不允許的格式,對于文本格式和代碼文件可以進(jìn)行編輯2008-10-10