| 1 | | {html_head} |
| 2 | | <link rel="stylesheet" type="text/css" href="themes/kardon/slideshow.css"> |
| 3 | | {/html_head} |
| | 1 | {combine_css path="themes/kardon/slideshow.css"} |
| | 2 | |
| | 3 | {footer_script require="jquery"}{literal} |
| | 4 | jQuery(document).ready(function() { |
| | 5 | var maxWidth = maxHeight = margin = 0; |
| | 6 | var finalW = w = {/literal}{$WIDTH_IMG}{literal}, finalH = h = {/literal}{$HEIGHT_IMG}{literal}; |
| | 7 | if (typeof( window.innerWidth ) == 'number') { |
| | 8 | // Non-IE |
| | 9 | maxWidth = window.innerWidth; |
| | 10 | maxHeight = window.innerHeight; |
| | 11 | } |
| | 12 | else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { |
| | 13 | //IE 6+ in 'standards compliant mode' |
| | 14 | maxWidth = document.documentElement.clientWidth; |
| | 15 | maxHeight = document.documentElement.clientHeight; |
| | 16 | } |
| | 17 | else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { |
| | 18 | // IE 4 compatible |
| | 19 | maxWidth = document.body.clientWidth; |
| | 20 | maxHeight = document.body.clientHeight; |
| | 21 | } |
| | 22 | |
| | 23 | maxHeight = maxHeight-32; |
| | 24 | if ((h > maxHeight) || (w > maxWidth)) { |
| | 25 | if ((h > maxHeight) && (w > maxWidth)) { |
| | 26 | if (maxHeight-h < maxWidth-w) { |
| | 27 | finalH = maxHeight; |
| | 28 | finalW = w * finalH / h; |
| | 29 | } |
| | 30 | else { |
| | 31 | finalW = maxWidth; |
| | 32 | finalH = h * finalW / w; |
| | 33 | } |
| | 34 | } |
| | 35 | else if ((h > maxHeight) && (w < maxWidth)) { |
| | 36 | finalH = maxHeight; |
| | 37 | finalW = w * finalH / h; |
| | 38 | } |
| | 39 | else if ((h < maxHeight) && (w > maxWidth)) { |
| | 40 | finalW = maxWidth; |
| | 41 | finalH = h * finalW / w; |
| | 42 | } |
| | 43 | } |
| | 44 | if ((maxHeight-finalH) > 0) { |
| | 45 | margin = Math.round((maxHeight-finalH) / 2) |
| | 46 | } |
| | 47 | |
| | 48 | jQuery("#theImage").append('<img style="margin-top:'+margin+'px; width:'+finalW+'px;height:'+finalH+'px" src="{/literal}{$SRC_IMG}{literal}" alt="">'); |
| | 49 | }); |
| | 50 | {/literal}{/footer_script} |
| 22 | | {literal} |
| 23 | | <script type="text/javascript">//<!-- |
| 24 | | |
| 25 | | var maxWidth = maxHeight = margin = 0; |
| 26 | | var finalW = w = {/literal}{$WIDTH_IMG}{literal}, finalH = h = {/literal}{$HEIGHT_IMG}{literal}; |
| 27 | | if( typeof( window.innerWidth ) == 'number' ) { |
| 28 | | //Non-IE |
| 29 | | maxWidth = window.innerWidth; |
| 30 | | maxHeight = window.innerHeight; |
| 31 | | } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { |
| 32 | | //IE 6+ in 'standards compliant mode' |
| 33 | | maxWidth = document.documentElement.clientWidth; |
| 34 | | maxHeight = document.documentElement.clientHeight; |
| 35 | | } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { |
| 36 | | //IE 4 compatible |
| 37 | | maxWidth = document.body.clientWidth; |
| 38 | | maxHeight = document.body.clientHeight; |
| 39 | | } |
| 40 | | maxHeight = maxHeight-32; |
| 41 | | if ((h > maxHeight) || (w > maxWidth)) { |
| 42 | | if ((h > maxHeight) && (w > maxWidth)) { |
| 43 | | if (maxHeight-h < maxWidth-w) { |
| 44 | | finalH = maxHeight; |
| 45 | | finalW = w * finalH / h; |
| 46 | | } |
| 47 | | else { |
| 48 | | finalW = maxWidth; |
| 49 | | finalH = h * finalW / w; |
| 50 | | } |
| 51 | | } |
| 52 | | else if ((h > maxHeight) && (w < maxWidth)) { |
| 53 | | finalH = maxHeight; |
| 54 | | finalW = w * finalH / h; |
| 55 | | } |
| 56 | | else if ((h < maxHeight) && (w > maxWidth)) { |
| 57 | | finalW = maxWidth; |
| 58 | | finalH = h * finalW / w; |
| 59 | | } |
| 60 | | } |
| 61 | | if ((maxHeight-finalH) > 0) { |
| 62 | | margin = Math.round((maxHeight-finalH) / 2) |
| 63 | | } |
| 64 | | document.writeln("<img style=\"margin-top:"+margin+"px; width:"+finalW+"px;height:"+finalH+"px\" src=\"{/literal}{$SRC_IMG}{literal}\" alt=\"\">"); |
| 65 | | |
| 66 | | //--> |
| 67 | | </script> |
| 68 | | {/literal} |