Voting Chart

Total votes : 1

is the website okay otherwise?

  •  
    yes
  •  
    no

display:none in Mozilla and Phoenix

  • lachlanmullen
  • Novice
  • Novice
  • lachlanmullen
  • Posts: 21

Post 3+ Months Ago

hay, sheck out [blur]:arrow: [/blur]<a href="http://www.sparkwash.com" target="_new">sparkwash.com</a> [using IE] and tell me if anys of yous know how to script like mad to:

1) have the page load with STYLE="display:block"

or

2) reference a seperate stylesheet if a user attempts to view with non-IE.

right now it won't work in mozilla or Opera or NS or Phoe etc coz they don't allow for dynamic page modifications without a cache forcing type script. anyways, i'm at a bit of a loss here.

hlp please :(.

thx
lach :2gunfire:
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9101
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I think it would be something along the lines of:

document.getElementById("elementName").style.display = 'block';

You would simply put that in the head section between javascript tags. The elementName would be changed to the name of the element that you want the style applied to. I havent tested it, so I am not sure if this will work. But I think it would be something along these lines. Hope that puts you in the right direction.
  • lachlanmullen
  • Novice
  • Novice
  • lachlanmullen
  • Posts: 21

Post 3+ Months Ago

i am sorry, i guess i do not understand fully.

how would this discriminate between IE and non-IE browsers?

i have not tested it yet, but even if it does work, i will not be comforatble until i understand it.

thanks man.

lach :2gunfire:
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9101
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Well here is an example how you can figure out if its netscape and if its version 4 and then if its 4 it would execute the block, for which you could put some kind of code like I gave you above

Code: [ Select ]
<script language="JavaScript">
<!--
if ((appName=="Netscape") && (parseInt(appVersion)==4)) {
  //do stuff here
  //do stuff here
  //do stuff here
}
//-->
</script>
  1. <script language="JavaScript">
  2. <!--
  3. if ((appName=="Netscape") && (parseInt(appVersion)==4)) {
  4.   //do stuff here
  5.   //do stuff here
  6.   //do stuff here
  7. }
  8. //-->
  9. </script>


If you just want to determine if its Netscape and you do not care what version it is, you could do something like this:

Code: [ Select ]
<script language="JavaScript">
<!--
if (appName=="Netscape"){
  //do stuff here
  //do stuff here
  //do stuff here
}
//-->
</script>
  1. <script language="JavaScript">
  2. <!--
  3. if (appName=="Netscape"){
  4.   //do stuff here
  5.   //do stuff here
  6.   //do stuff here
  7. }
  8. //-->
  9. </script>
  • lachlanmullen
  • Novice
  • Novice
  • lachlanmullen
  • Posts: 21

Post 3+ Months Ago

soo,

could i use the following:
Code: [ Select ]
<script language="JavaScript">
<!--
if (appName=="IE") && (parseInt(appVersion)==4)) {
document.getElementById("TD.middleBoxText").style.display = 'block';
}
//-->
</script>
  1. <script language="JavaScript">
  2. <!--
  3. if (appName=="IE") && (parseInt(appVersion)==4)) {
  4. document.getElementById("TD.middleBoxText").style.display = 'block';
  5. }
  6. //-->
  7. </script>


Would that then apply style.display = 'block'; to my TD with the class='middleBoxText' ONLY if the user is using IE 4+?

and also, doesn't the app need a 'then' ststement, or is the default than just do nothing?

when i try to run it on my page i get a syntax error, and i'm still not fully undrestanding it.

thanks man,
lach :2gunfire:

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 57 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.