Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 10-21-2007, 01:44 PM   #1 (permalink)
Junior Member
 
nster's Avatar
 
Join Date: 11-06-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

nster is liked by many
Question Javascript - I click ones ok - o click for second time and dosent work why ?

Hello guyz,

am testing the following javascript (its a kind of JS-menu) and works all right, but i want to get something more..

If i click ones, (par example) on
Quote:
"menu item 1"
,
i will get :
Quote:
menu sub item
menu sub item
menu sub item
menu sub item
menu sub item
menu sub item
But,, if i try to click on
Quote:
"menu item 1"
again,
then nothing will happend ..and the :
Quote:
menu sub item
menu sub item
menu sub item
menu sub item
menu sub item
menu sub item
..will not appear

..this is what i want to solve, so when i click on "menu item 1" , "menu item 2" , " menu item 3 " again after ones to work like before the fist time .


Please help me to do this,
thanks


Code:
<html> <head> <title>js test</title> <script> var p = 0; function show_mnu(id){ var e = document.getElementById(id); e.style.display = 'block'; hide_mnu(id); p = id; } function hide_mnu(id){ if(p != 0){ var e = document.getElementById(p); e.style.display = 'none'; } } </script> </head> <body> <table> <tr> <td width="125px" valign="top" nowrap> <a href="JavaScript:void(0);" onClick="show_mnu('mnu_top_01')">menu item 1</a><br /> <div id="mnu_top_01"> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> </div> <a href="JavaScript:void(0);" onClick="show_mnu('mnu_top_02')">menu item 2</a><br /> <div id="mnu_top_02"> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> </div> <a href="JavaScript:void(0);" onClick="show_mnu('mnu_top_03')">menu item 3</a><br /> <div id="mnu_top_03"> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> <span>menu sub item</span><br /> </div> </td> </tr> </table> </body> </html>
nster is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-21-2007, 08:36 PM   #2 (permalink)
Meeow!
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 3,235
iTrader: 0 / 0%
Latest Blog:
None

Costin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest order
the quickest way: verify the state (the visibility) of each div, and if the div is hidden, make it visible...
__________________
...to be continued
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-22-2007, 01:34 AM   #3 (permalink)
Junior Member
 
nster's Avatar
 
Join Date: 11-06-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

nster is liked by many
Question

but this is happening already in the script no ?

hm can you give an example based on the code above plz ?
nster is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-22-2007, 08:10 AM   #4 (permalink)
Meeow!
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 3,235
iTrader: 0 / 0%
Latest Blog:
None

Costin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest order
you mean something like doing it for you, right?

I'll think about it...
__________________
...to be continued
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-23-2007, 02:47 PM   #5 (permalink)
Meeow!
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 3,235
iTrader: 0 / 0%
Latest Blog:
None

Costin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest order
Here you'll find the answer to your question:
http://www.projectseven.com/tutorial...menu/index.htm

Scroll down to the "Download Extensions and Work Files" section and download the zip archive.
__________________
...to be continued
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Long time for make website not get the click nuttaphong191 SEO Forum 1 03-12-2007 11:04 AM
Click here Ferre Google Forum 23 08-03-2005 10:42 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 11:19 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.