Need some help...

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Any one?
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back