NameSilo

Need some help...

SpaceshipSpaceship
Watch

Splinter Freelance

Established Member
Impact
1
I am trying to change the height of a div if the browser is IE. Here is the code I have:
var detect = navigator.userAgent.toLowerCase();
var thestring;
var doAlerts=false;

function changeSheets(whichSheet){
whichSheet=whichSheet-1;
if(document.styleSheets){
var c = document.styleSheets.length;
if (doAlerts) alert('Change to Style '+(whichSheet+1));
for(var i=0;i<c;i++){
if(i!=whichSheet){
document.styleSheets.disabled=true;
document.styleSheets[0].disabled=false;
}else{
document.styleSheets.disabled=false;
document.styleSheets[0].disabled=false;
}
}
}
}
function checkIt(string)
{
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}
if (checkIt('msie')){
changeSheets(2);
<?php if(!$page || !isset($page)){
echo ('document.getElementById("left4").style.height=24+"px";');
}?>

}
else if (checkIt('mozilla')){
changeSheets(3);
}

It wont work and Im not sure why. Ive used a similar code to this before and it worked fine. Perhaps there is an error I am not noticing?

Also... is there any way to use a php $_GET variable in Javascript?


Thanks,

Sam
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Any one?
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
NameMaxi - Your Domain Has Buyers
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back