Changeset 27412 for extensions/modus/js/thumb.arrange.js
- Timestamp:
- Feb 19, 2014, 6:14:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/modus/js/thumb.arrange.js
r26836 r27412 15 15 if (this.elements.length === 0) 16 16 this.firstThumbIndex = absIndex; 17 if (!$elt.data("w")) 18 { 19 var w=$elt.width(), h=$elt.height(); 17 var w,h; 18 19 if (! (w=$elt.data("w")) ) { 20 if ( (w=$elt[0].getAttribute("width")) && (w=parseInt(w)) ) { 21 h=parseInt($elt[0].getAttribute("height")); 22 } 23 else { 24 w=$elt.width(); 25 h=$elt.height(); 26 } 20 27 if (h > this.rowHeight) { 21 28 w = Math.round(w * this.rowHeight/h); … … 25 32 .data("h", h); 26 33 } 34 else 35 h=$elt.data("h"); 36 27 37 28 38 var eltObj = { 29 39 $elt: $elt, 30 w: $elt.data("w"),31 h: $elt.data("h")40 w: w, 41 h: h 32 42 }; 33 43 this.elements.push(eltObj); … … 166 176 167 177 reposition: function($img, imgW, imgH, liW, liH) { 168 $img.attr("width", imgW) 169 .attr("height", imgH); 178 /* JQuery .attr and .css functions add too much overhead ...*/ 179 var elt = $img[0]; 180 elt.setAttribute("width", imgW+""); 181 elt.setAttribute("height", imgH+""); 170 182 171 $img.closest("li").css( { 172 width: liW+"px", 173 height: liH+"px" 174 }); 183 elt = elt.parentNode;//a 184 elt.style.left = Math.round((liW-imgW)/2)+"px"; 185 elt.style.top = Math.round((liH-imgH)/2)+"px"; 175 186 176 $img.parent("a").css( {177 left: Math.round((liW-imgW)/2)+"px",178 top: Math.round((liH-imgH)/2)+"px"179 }); 187 elt = elt.parentNode;//li 188 elt.style.width = liW+"px"; 189 elt.style.height = liH+"px"; 190 180 191 } 181 192
Note: See TracChangeset
for help on using the changeset viewer.