source: extensions/Back2Front/template/picture_content.tpl @ 10852

Last change on this file since 10852 was 10852, checked in by mistic100, 13 years ago

improve process, add options for link effect

File size: 3.1 KB
Line 
1{combine_css path=$B2F_PATH|@cat:"template/style.css"}
2
3{footer_script require="jquery"}
4jQuery(document).ready(function () {ldelim}
5
6{if $b2f_switch_mode == 'click'}
7  jQuery('.reverse').click(function() {ldelim}
8    if (jQuery(this).attr('rel') == 'front') {ldelim}
9{else}
10  jQuery('.reverse').hover(function() {ldelim}
11{/if}
12
13      /* picture switch */
14    {if $b2f_transition == 'fade'}
15      jQuery('img[alt="{$ALT_IMG}"]').animate({ldelim}
16        opacity:0
17      }, 400, function() {ldelim}
18        jQuery(this).animate({ldelim}
19          width:'{$VERSO_WIDTH}px',
20          height:'{$VERSO_HEIGHT}px'
21        }, 200, function() {ldelim}
22            jQuery(this).attr('src', '{$VERSO_URL}');
23            jQuery(this).animate({ldelim}
24              opacity:1
25            }, 400);
26        });
27      });
28    {else}
29      jQuery('img[alt="{$ALT_IMG}"]').attr({ldelim}
30        src: '{$VERSO_URL}',
31        style: 'width:{$VERSO_WIDTH}px;height:{$VERSO_HEIGHT}px;',
32      });
33    {/if}
34   
35    {if $b2f_switch_mode == 'click'}
36      /* hd link */
37      {if isset($VERSO_HD)}
38      jQuery('img[alt="{$ALT_IMG}"]').parent().attr({ldelim}
39        href: "javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"
40      });
41      {/if}
42   
43      /* B2F link content */
44      jQuery(this).html('<img src="{$B2F_PATH}template/rotate_2.png"/> {'See front'|@translate}');
45      jQuery(this).attr('rel', 'back');
46    {/if}
47     
48{if $b2f_switch_mode == 'click'}
49    } else if (jQuery(this).attr('rel') == 'back') {ldelim}
50{else}
51  }, function() {ldelim}
52{/if}
53
54    {if $b2f_transition == 'fade'}
55      jQuery('img[alt="{$ALT_IMG}"]').animate({ldelim}
56        opacity:0
57      }, 400, function() {ldelim}
58        jQuery(this).animate({ldelim}
59          width:'{$WIDTH_IMG}px',
60          height:'{$HEIGHT_IMG}px'
61        }, 200, function() {ldelim}
62            jQuery(this).attr('src', '{$SRC_IMG}');
63            jQuery(this).animate({ldelim}
64              opacity:1
65            }, 400);
66        });
67      });
68    {else}
69      jQuery('img[alt="{$ALT_IMG}"]').attr({ldelim}
70        src: '{$SRC_IMG}',
71        style: 'width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;',
72      });
73    {/if}
74     
75    {if $b2f_switch_mode == 'click'}
76      {if isset($high.U_HIGH)}
77      jQuery('img[alt="{$ALT_IMG}"]').parent().attr({ldelim}
78        href: "javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"
79      });
80      {/if}
81     
82      jQuery(this).html('<img src="{$B2F_PATH}template/rotate_1.png"/> {'See back'|@translate}');
83      jQuery(this).attr('rel', 'front');
84    {/if}
85     
86{if $b2f_switch_mode == 'click'}
87    }
88  });
89{else}
90  });
91{/if}
92
93});
94{/footer_script}
95
96<img src="{$VERSO_URL}" style="display:none;"> {* <!-- force preload the verso --> *}
97
98<a class="reverse" rel="front" name="verso-link" {if $b2f_switch_mode == 'hover'}href="javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"{/if}>
99  <img src="{$B2F_PATH}template/rotate_1.png"/> {'See back'|@translate}
100</a>
101<br/>
Note: See TracBrowser for help on using the repository browser.