Index: trunk/extensions/VipsScaler/modules/ext.vipsScaler/ext.vipsScaler.js |
— | — | @@ -52,6 +52,24 @@ |
53 | 53 | caption: true, |
54 | 54 | reveal: 0.5 |
55 | 55 | }); |
| 56 | + |
| 57 | + /** Also add a click handler to instantly switch beetween pics */ |
| 58 | + $('#mw-vipstest-thumbnails').click( function() { |
| 59 | + var e = $(this) |
| 60 | + var mask = e.children(".uc-mask") |
| 61 | + var caption = e.children(".uc-caption") |
| 62 | + |
| 63 | + width = e.width(); |
| 64 | + maskWidth = mask.width(); |
| 65 | + |
| 66 | + if( maskWidth < width / 2 ) { |
| 67 | + mask.width( width ); |
| 68 | + caption.html( e.children("img:eq(0)").attr("alt") ); |
| 69 | + } else { |
| 70 | + mask.width( 0 ); |
| 71 | + caption.html( e.children("img:eq(1)").attr("alt") ); |
| 72 | + } |
| 73 | + }); |
56 | 74 | } |
57 | 75 | } |
58 | 76 | ); |