JS(jquery)實現圖片放大鏡效果

來源:互聯網
上載者:User

本例中主要用到了jquery.js,jquery.jqzoom.js以及樣式jqzoom.css,
為了示範方便,這裡引用了一個購物網站的絕對路徑,大家可以把jquery代碼下過來自己用 .

應用參考:http://www.vancl.com/ProductInfo/1120222.html

img標籤中的
alt是大圖片的路徑,
src是小圖片的路徑,
class=jqzoom,設定樣式,
border=0圖片的邊框。

下面的MM怎麼樣啊,呵呵!!!!

<HTML> 
<META http-equiv=Content-Type content="text/html; charset=utf-8"> 

<link href="http://www.vancl.com/css/jqzoom.css" type="text/css" rel="stylesheet" /> 

<SCRIPT src="http://www.vancl.com/PublicControls/js/jquery.js" type=text/javascript></SCRIPT> 

<SCRIPT src="http://www.vancl.com/PublicControls/js/jquery.jqzoom.js"></SCRIPT> 


<SCRIPT type=text/javascript>... 
jQuery.noConflict(); 
jQuery(document).ready(function()...{ 
jQuery("img.jqzoom").jqueryzoom(...{ 
xzoom: 280, 
yzoom: 280, 
offset: 15, 
position: "right" 
}); 
}); 
</SCRIPT> 

<BODY> 

<IMG class=jqzoom 
alt=http://img.article.pchome.net/game/00/07/75/84/pic_lib/wm/424.jpg 
src=http://t1.baidu.com/it/u=2111826760,700048667&fm=0&gp=6.jpg 
border=0 > 
</BODY> 

</HTML> 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.