Line | |
---|
1 | // LLGBO frame resize |
---|
2 | jQuery(document).ready(function(jQuery){ |
---|
3 | jQuery("#theMainImage").load(function(){LlgboFr_Resize();}); |
---|
4 | jQuery(window).resize(function(){ LlgboFr_Resize(); }); |
---|
5 | }); |
---|
6 | var LlgboFr_Resize = function () { |
---|
7 | var elGbo = document.getElementById("llgbo0"); |
---|
8 | if (elGbo) { |
---|
9 | var MainImg = document.getElementById("theMainImage"); |
---|
10 | var nFrH = parseInt(MainImg.height); |
---|
11 | var nFrW = parseInt(MainImg.width); |
---|
12 | var ReadImgSize = document.getElementById("LLGBO_READIMGREELSIZE"); |
---|
13 | if (ReadImgSize) { |
---|
14 | // Must read via URL the physical size of the img |
---|
15 | var x = document.createElement('img'); |
---|
16 | x.id = 'NewImgx'; |
---|
17 | document.getElementsByTagName('body')[0].appendChild(x); |
---|
18 | x.style.top = '0'; |
---|
19 | x.style.visibility = 'hidden'; |
---|
20 | x.src = MainImg.src; |
---|
21 | nFrH = parseInt(x.height); |
---|
22 | nFrW = parseInt(x.width); |
---|
23 | document.getElementsByTagName('body')[0].removeChild(x); |
---|
24 | } |
---|
25 | |
---|
26 | var FrLstBdr = 0, i = 0; |
---|
27 | for ( i=1; i<32; i=i+2 ) |
---|
28 | {var Fr = document.getElementById("llgboframe"+(i)); |
---|
29 | var frbdr = 0; |
---|
30 | if (Fr) { |
---|
31 | frbdr = parseInt(Fr.style.borderWidth);} |
---|
32 | FrLstBdr = (frbdr * 2)+FrLstBdr; |
---|
33 | } |
---|
34 | elGbo.style.width = (nFrW + FrLstBdr) + "px"; |
---|
35 | elGbo.style.height =(nFrH + FrLstBdr) + "px"; |
---|
36 | } |
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.