Webmaster Forum

Ezilon Directory   High Bandwidth Dedicated Servers   V7N Directory
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Reply
 
LinkBack Thread Tools Display Modes
Old 10-21-2007, 12:44 PM   #1 (permalink)
Inactive
 
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
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 10-21-2007, 07:36 PM   #2 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania (atm)
Posts: 2,851
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
the quickest way: verify the state (the visibility) of each div, and if the div is hidden, make it visible...
__________________
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-22-2007, 12:34 AM   #3 (permalink)
Inactive
 
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, 07:10 AM   #4 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania (atm)
Posts: 2,851
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
you mean something like doing it for you, right?

I'll think about it...
__________________
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-23-2007, 01:47 PM   #5 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania (atm)
Posts: 2,851
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
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.
__________________
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > 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

vB 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 10:04 AM
Click here Ferre Google Forum 23 08-03-2005 09:42 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 01:06 PM.
© Copyright 2008 V7 Inc


Search Engine Optimization by vBSEO 3.1.0 ©2007, Crawlability, Inc.