jQuery簡(jiǎn)易圖片放大特效示例代碼
更新時(shí)間:2014年06月09日 11:23:34 作者:
這篇文章主要介紹了通過(guò)jQuery實(shí)現(xiàn)的簡(jiǎn)易圖片放大特效,需要的朋友可以參考下
DEMO點(diǎn)擊圓形圖片,圖片方法,將水的圖片放置與下層,鼠標(biāo)移上去的時(shí)候,圖片高與寬同比增大,并且圖片向左上移動(dòng)
代碼
<!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>無(wú)標(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>無(wú)標(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)圖片滾動(dòng)切換效果
- 用JQuery模仿淘寶的圖片放大鏡顯示效果
- 基于Jquery實(shí)現(xiàn)的一個(gè)圖片滾動(dòng)切換
- jQuery+css實(shí)現(xiàn)圖片滾動(dòng)效果(附源碼)
- jquery圖片放大鏡功能的實(shí)例代碼
- Jquery圖片滾動(dòng)與幻燈片的實(shí)例代碼
- jQuery bxCarousel實(shí)現(xiàn)圖片滾動(dòng)切換效果示例代碼
- jQuery圖片滾動(dòng)圖片的效果(另類實(shí)現(xiàn))
- jquery圖片放大功能簡(jiǎn)單實(shí)現(xiàn)
- jQuery實(shí)現(xiàn)圖片放大預(yù)覽實(shí)現(xiàn)原理及代碼
- jquery實(shí)現(xiàn)圖片滾動(dòng)效果的簡(jiǎn)單實(shí)例
- JQuery 圖片滾動(dòng)輪播示例代碼
- 一個(gè)jquery實(shí)現(xiàn)的不錯(cuò)的多行文字圖片滾動(dòng)效果
- jquery實(shí)現(xiàn)多行文字圖片滾動(dòng)效果示例代碼
- jQuery實(shí)現(xiàn)類似淘寶網(wǎng)圖片放大效果的方法
- jquery圖片滾動(dòng)放大代碼分享(1)
相關(guān)文章
jquery統(tǒng)計(jì)用戶選中的復(fù)選框的個(gè)數(shù)
使用選擇器得到所有被勾選的復(fù)選框元素的集合,然后通過(guò)判斷元素的個(gè)數(shù)來(lái)得到用戶勾選的個(gè)數(shù),需要的朋友可以參考下2014-06-06jQuery通過(guò)ajax請(qǐng)求php遍歷json數(shù)組到table中的代碼(推薦)
這篇文章主要介紹了jQuery通過(guò)ajax請(qǐng)求php遍歷json數(shù)組到table中代碼(推薦)的相關(guān)資料,非常不錯(cuò)具有參考借鑒價(jià)值,需要的朋友可以參考下2016-06-06使用jQuery實(shí)現(xiàn)簡(jiǎn)單穿梭框方式
這篇文章主要介紹了使用jQuery實(shí)現(xiàn)簡(jiǎn)單穿梭框方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-10-10jquery實(shí)現(xiàn)滑屏大圖定時(shí)收縮為小banner圖片的廣告代碼
這篇文章主要介紹了jquery實(shí)現(xiàn)滑屏大圖定時(shí)收縮為小banner圖片的廣告代碼,可實(shí)現(xiàn)大幅廣告圖的漸顯效果及定時(shí)收縮功能,點(diǎn)擊左上角關(guān)閉按鈕還可隱藏廣告圖片,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-09-09JQuery AJAX實(shí)現(xiàn)目錄瀏覽與編輯的代碼
這部分作為后臺(tái)的一部分實(shí)現(xiàn),目的是實(shí)現(xiàn)某個(gè)指定目錄下所有文件夾和文件的瀏覽,同時(shí)不顯示不允許的格式,對(duì)于文本格式和代碼文件可以進(jìn)行編輯2008-10-10動(dòng)態(tài)加載jQuery的兩種方法實(shí)例分析
這篇文章主要介紹了動(dòng)態(tài)加載jQuery的兩種方法,實(shí)例分析了jquery動(dòng)態(tài)加載的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-07-07