Forum Moderators: open

Message Too Old, No Replies

Need some help

modifing this script a bit.

         

cripplertd

9:57 pm on Oct 5, 2007 (gmt 0)

10+ Year Member




function getBrowserWidth(){
if (window.innerWidth){
return window.innerWidth;}
else if (document.documentElement && document.documentElement.clientWidth!= 0){
return document.documentElement.clientWidth;}
else if (document.body){return document.body.clientWidth;}
return 0;
}

// dynamicLayout by Kevin Hale
function dynamicLayout(){
var browserWidth = getBrowserWidth();

//Load span id background800 rest are hidden
if (browserWidth < 800){
changeLayout("background800");
}
//Load Wide CSS Rules
if ((browserWidth >= 800) && (browserWidth <= 1020)){
changeLayout("background1024");
}
//Load Wider CSS Rules
if (browserWidth > 1021){
changeLayout("background1152");
}
}

I need to define changeLayout function so it shows/hides differnt span id's ie "background1152" and hides bacground1024 / background800

cripplertd

12:03 am on Oct 9, 2007 (gmt 0)

10+ Year Member



any sites with examples that I can be pointed to?