jQuery實現(xiàn)類似淘寶網(wǎng)圖片放大效果的方法
更新時間:2015年07月08日 15:59:57 作者:沉淀歲月
這篇文章主要介紹了jQuery實現(xiàn)類似淘寶網(wǎng)圖片放大效果的方法,實例分析了jquery實現(xiàn)圖片放大效果的方法,涉及jquery操作鼠標事件及頁面元素屬性修改的相關(guān)技巧,需要的朋友可以參考下
本文實例講述了jQuery實現(xiàn)類似淘寶網(wǎng)圖片放大效果的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <title>類似淘寶網(wǎng)的圖片放大代碼</title> <script type="text/javascript" src="js/jquery1.3.2.js"></script> <style type="text/css"> #tip {position:absolute;color:#333;display:none;} #tip s {position:absolute;top:40px;left:-20px;display:block;width:0px;height:0px;font-size:0px;line-height:0px;border-color:transparent #BBA transparent transparent;border-style:dashed solid dashed dashed;border-width:10px;} #tip s i {position:absolute;top:-10px;left:-8px;display:block;width:0px;height:0px;font-size:0px;line-height:0px;border-color:transparent #fff transparent transparent;border-style:dashed solid dashed dashed;border-width:10px;} #tip .t_box {position:relative;background-color:#CCC;filter:alpha(opacity=50);-moz-opacity:0.5;bottom:-3px;right:-3px;} #tip .t_box div {position:relative;background-color:#FFF;border:1px solid #ACA899;background:#FFF;padding:1px;top:-3px;left:-3px;} .tip {width:82px;height:82px;border:1px solid #DDD;} </style> <script type="text/javascript"> $(function(){ $('.tip').mouseover(function(){ var $tip=$('<div id="tip"><div class="t_box"><div><s><i></i></s><img src="'+this.src+'" /></div></div></div>'); $('body').append($tip); $('#tip').show('fast'); }).mouseout(function(){ $('#tip').remove(); }).mousemove(function(e){ $('#tip').css({"top":(e.pageY-60)+"px","left":(e.pageX+30)+"px"}) }) }) </script> <p> </p> <a href="/"><img class="tip" src="/jscss/demoimg/201012/1.jpg" /></a> <a href="#"><img class="tip" src="/jscss/demoimg/201012/2.jpg" /></a> <a href="#" ><img class="tip" src="/jscss/demoimg/201012/3.jpg" /></a>
希望本文所述對大家的jquery程序設(shè)計有所幫助。
相關(guān)文章
jQuery實現(xiàn)按鈕的點擊 全選/反選 單選框/復(fù)選框 文本框 表單驗證
這篇文章主要介紹了jQuery實現(xiàn)按鈕的點擊 全選/反選 單選框/復(fù)選框 文本框 表單驗證的相關(guān)資料,需要的朋友可以參考下2015-06-06jquery通過擴展select控件實現(xiàn)支持enter或focus選擇的方法
這篇文章主要介紹了jquery通過擴展select控件實現(xiàn)支持enter或focus選擇的方法,通過jQuery針對select空間增加enter及focus選擇功能分析了jQuery擴展的相關(guān)實現(xiàn)技巧,需要的朋友可以參考下2015-11-11ajax更新數(shù)據(jù)后,jquery、jq失效問題
這問題遇到兩次,竟然忘記了。所以說不要關(guān)抄人家的方法,要多研究下?,F(xiàn)在做個記錄...2011-03-03Jquery ajaxsubmit上傳圖片實現(xiàn)代碼
這是數(shù)月前的事情了,場景是這樣的: 在進行圖片上傳的時,我發(fā)現(xiàn)開發(fā)人員使用的上傳圖片方式是Iframe + 傳統(tǒng)的 http post 來處理的。2010-11-11