Hi users,
I am building a script that checks every n interval (1 second for example) the offsetHeight of two layers. If this value changes it updates margin-top value for another layer. Here is below the basic structure i set up:
function screen()
var screenSize = screen.offsetWidth;
screenSize = w
function checker()
var timer = setTimeout: count from nTime to n+1Time // defines a period of 1 second
timer = t
var listener = ( check for w < or > than w ) inside t // if the user resizes his window
if
inside t, w changes
document.getElementById('article').style.marginTop = 'n';
n = (firstDiv.offsetHeight + secondDiv.offsetHeight) + "px";
else
var firstDiv = document.getElementById("FirstOne");
var secondDiv = document.getElementById("SecondOne");
var artDiv = document.getElementById("Article");
artDiv.style.marginTop = (firstDiv.offsetHeight + secondDiv.offsetHeight) + "px";
Could someone help me to build this up.
I am also wondering if this script would not have a bad impact on browser responsiveness.
Thanks
I am building a script that checks every n interval (1 second for example) the offsetHeight of two layers. If this value changes it updates margin-top value for another layer. Here is below the basic structure i set up:
function screen()
var screenSize = screen.offsetWidth;
screenSize = w
function checker()
var timer = setTimeout: count from nTime to n+1Time // defines a period of 1 second
timer = t
var listener = ( check for w < or > than w ) inside t // if the user resizes his window
if
inside t, w changes
document.getElementById('article').style.marginTop = 'n';
n = (firstDiv.offsetHeight + secondDiv.offsetHeight) + "px";
else
var firstDiv = document.getElementById("FirstOne");
var secondDiv = document.getElementById("SecondOne");
var artDiv = document.getElementById("Article");
artDiv.style.marginTop = (firstDiv.offsetHeight + secondDiv.offsetHeight) + "px";
Could someone help me to build this up.
I am also wondering if this script would not have a bad impact on browser responsiveness.
Thanks