Line | |
---|
1 | {combine_script id='jquery.imgpreview' load='header' require='jquery' path='plugins/imgpreview/js/imgpreview.js'} |
---|
2 | |
---|
3 | {footer_script require='jquery.imgpreview'} |
---|
4 | {if isset($imgpreview)} |
---|
5 | {literal} |
---|
6 | jQuery('.thumbnails a, #thumbnails a').imgPreview({ |
---|
7 | containerID: 'tooltip', |
---|
8 | srcAttr: 'imgsrc', |
---|
9 | considerBorders:'true', |
---|
10 | // When container is shown: |
---|
11 | onShow: function(link){ |
---|
12 | {/literal}{if $imgpreview.title=="true"}{literal} |
---|
13 | jQuery('<span>' + jQuery(link).children().attr("title") + '</span>').appendTo(this); |
---|
14 | |
---|
15 | {/literal}{/if}{if $imgpreview.opacity=="true"}{literal} |
---|
16 | jQuery(link).stop().animate({opacity:0.4}); |
---|
17 | // Reset image: |
---|
18 | jQuery('img', this).stop().css({opacity:0}); |
---|
19 | {/literal}{/if}{literal} |
---|
20 | }, |
---|
21 | onLoad: function(){ |
---|
22 | {/literal}{if $imgpreview.opacity=="true"}{literal} |
---|
23 | jQuery(this).animate({opacity:1}, 300); |
---|
24 | {/literal}{/if}{literal} |
---|
25 | }, |
---|
26 | // When container hides: |
---|
27 | onHide: function(link){ |
---|
28 | {/literal}{if $imgpreview.title=="true"}{literal} |
---|
29 | jQuery('span', this).remove(); |
---|
30 | {/literal}{/if}{if $imgpreview.opacity=="true"}{literal} |
---|
31 | jQuery(link).stop().animate({opacity:1}); |
---|
32 | {/literal}{/if}{literal} |
---|
33 | } |
---|
34 | }); |
---|
35 | |
---|
36 | {/literal} |
---|
37 | {/if} |
---|
38 | {/footer_script} |
---|
39 | |
---|
40 | {combine_css path="plugins/imgpreview/css/imgpreview.css"} |
---|
41 | {if isset($imgpreview)} |
---|
42 | {html_head} |
---|
43 | {literal} |
---|
44 | <style> |
---|
45 | #tooltip img { |
---|
46 | {/literal} |
---|
47 | max-height: {$imgpreview.height}px; |
---|
48 | max-width: {$imgpreview.width}px; |
---|
49 | {literal} |
---|
50 | } |
---|
51 | </style> |
---|
52 | {/literal}{/html_head} |
---|
53 | {/if} |
---|
54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.