鼠标悬浮停留三秒后显示大图,在网页中还是比较实用的
1
2
3
4
5
6
7
|
<style> *{ margin : 0 ; padding : 0 ; list-style-type : none ;} img,a{ border : 0 ;} .piccon{ height : 75px ; margin : 100px 0 0 50px ;} .piccon li{ float : left ; padding : 0 10px ;} #preview{ position : absolute ; border : 1px solid #ccc ; background : #333 ; padding : 5px ; display : none ; color : #fff ; z-index : 2000 ;} </style> |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
<script type= "text/javascript" > this .imagePreview = function (){ xOffset = 10; yOffset = 30; var urll; $( ".widget .ks-content a,.box .ks-switchable-content div li a" ).hover( function (){ //$(".widget .ks-content a").hover(function(e){ //var goods_id = $(this).attr("href").replace("goods/", ""); var goods_id = $( this ).attr( "href" ).replace( "index.php?app=goods&id=" , "" ); this .t = this .title; this .title = " " ; var c = ( this .t != "" ) ? "<br/>" + this .t : " " ; $.post( "index.php?app=default&act=ajaxBigImage" , {goods_id: goods_id}, function (data){ $.ajaxSettings.async = false ; if (data!=0){ urll = data; $( "body" ).append( "<div id='preview'><img src=" + urll + " />" + c + "</div>" ); return true ; } else { return false ; } }); /* $("#preview") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px") .fadeIn("fast"); */ $( '#preview' ).css({ position: 'absolute' , left: ($(window).width() - $( '#preview' ).outerWidth())/2, top: ($(window).height() - $( '#preview' ).outerHeight())/2 + $(document).scrollTop() }); setTimeout( function (){ $( "#preview" ).fadeIn( "fast" ); },3000) }, function (){ this .title = this .t; $( "#preview" ).remove(); }); /* $("a.preview").mousemove(function(e){ $("#preview") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px"); }); */ }; $(document).ready( function (){ imagePreview(); }); </script> <div id= "_widget_579" name= "jdr_sale_list" widget_type= "widget" class= "widget" > <div class= "sale_list mt10 clearfix" > <h2>销售排行</h2> <div> <ul class= "ks-nav ks-nav1476271702" > <li class= "ks-active nav1" >特效礼花</li> <li class= "nav2" >套餐烟花</li> </ul> <div class= "ks-content" > <ul class= "box" id= "box1_1476271702" > <li > <div class= "pic" ><a href= "index.php?app=goods&id=331" ><img id="codetool">
延伸 · 阅读
精彩推荐
|