[Code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
02 <title>类似淘宝网的图片放大代码</title>
03 <script type="text/javascript" src="/ajaxjs/jquery1.3.2.js"></script>
04 <style type="text/css">
05 #tip {position:absolute;color:#333;display:none;}
06 #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;}
07 #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;}
08 #tip .t_box {position:relative;background-color:#CCC;filter:alpha(opacity=50);-moz-opacity:0.5;bottom:-3px;right:-3px;}
09 #tip .t_box div {position:relative;background-color:#FFF;border:1px solid #ACA899;background:#FFF;padding:1px;top:-3px;left:-3px;}
10
11 .tip {width:82px;height:82px;border:1px solid #DDD;}
12 </style>
13 <script type="text/javascript">
14 $(function(){
15 $(‘.tip’).mouseover(function(){
16 var $tip=$(‘<div id="tip"><div class="t_box"><div><s><i></i></s><img src="’+this.src+’" /></div></div></div>’);
17 $(‘body’).append($tip);
18 $(‘#tip’).show(‘fast’);
19 }).mouseout(function(){
20 $(‘#tip’).remove();
21 }).mousemove(function(e){
22 $(‘#tip’).css({"top":(e.pageY-60)+"px","left":(e.pageX+30)+"px"})
23 })
24 })
25 </script>
26 <p> </p>
27 <a href="/"><img class="tip" src="/jscss/demoimg/201012/1.jpg" /></a>
28 <a href="#"><img class="tip" src="/jscss/demoimg/201012/2.jpg" /></a>
29 <a href="#" ><img class="tip" src="/jscss/demoimg/201012/3.jpg" /></a>
[/Code]
评论前必须登录!
注册