Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Javascript Question - Easy.
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

dayve
Forum Moderator

USA
5820 Posts

Posted - 21 October 2003 :  12:40:44  Show Profile  Visit dayve's Homepage
I am really brain-farting this morning. I've done something like this countless times, but for some reason can not get it to work today. What am I doing wrong with this statement?

<script>
  var menu1=(getCookie('menu1')=="show")?"show":"hide";
  document.write ("<DIV style='display:" + (menu1) + ";' id='menu1Body' name='menu1Body'>")
</script>

dayve
Forum Moderator

USA
5820 Posts

Posted - 21 October 2003 :  14:28:48  Show Profile  Visit dayve's Homepage
using this for now, but still trying to figure out why the above post does not work.


<script>
  if (getCookie('menu2')=="show"){   
   	document.write ("<DIV style='display:show;' id='menu2Body' name='menu2Body'>")
   	  } else {
   	document.write ("<DIV style='display:hide;' id='menu2Body' name='menu2Body'>")
}
</script>

Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 21 October 2003 :  16:43:19  Show Profile  Visit D3mon's Homepage
are either show / hide keywords?


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 21 October 2003 :  17:06:34  Show Profile  Visit dayve's Homepage
quote:
Originally posted by D3mon

are either show / hide keywords?



I was thinking the same thing, but this works:


<script>
  menuView=(getCookie('menu1')=="show")?"block":"none";
  document.writeln ("<DIV style='display:" + menuView + ";' id='menu1Body' name='menu1Body'>")
</script>	


it accomplishes what I was trying to do, but I'd like to know why my other method didn't work. oh well, as long as I got it working. javascript cookies and divs are EVIL!


Edited by - dayve on 21 October 2003 17:08:13
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 22 October 2003 :  04:35:30  Show Profile  Visit D3mon's Homepage
Nah, just Javascript is Evil!


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07