gelcode
07-18-2002, 11:23 PM
Here's the problem... I am working on a page which is designed for a
1024x768 res, however looks okay on a 800x600. I want to set a OnLoad Show Layer command if browser width is less than 835 pix.
I am a newb at coding but have figured some stuff out. I grabbed this code off of two DW behaviors... how can I combine the two and make it work?
Resolution script...
//-->
//tmtC_resolutionRedirect
if (window.screen){
var w = screen.width;
tmt_url_800 = "resprob.htm";
if(w<835){
self.location.replace(tmt_url_800);
}
}//tmtC_resolutionRedirectEnd</script>
Show Layer script...
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null)
{ v=args[i+2];
if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
TIA
1024x768 res, however looks okay on a 800x600. I want to set a OnLoad Show Layer command if browser width is less than 835 pix.
I am a newb at coding but have figured some stuff out. I grabbed this code off of two DW behaviors... how can I combine the two and make it work?
Resolution script...
//-->
//tmtC_resolutionRedirect
if (window.screen){
var w = screen.width;
tmt_url_800 = "resprob.htm";
if(w<835){
self.location.replace(tmt_url_800);
}
}//tmtC_resolutionRedirectEnd</script>
Show Layer script...
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null)
{ v=args[i+2];
if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
TIA