Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , ,

Sponsored Links



Need help to show/hide div

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 15-04-2009
Nutty's Avatar
Member
 
Join Date: Feb 2008
Posts: 1,267
Need help to show/hide div

I am currently developing my website, here the idea:

There are 6 categories, the user clicks on the image of one of the categories

STEP 1: The user arrives on the home page of the gallery, and has the choice among the categories of creations

Step2: The user clicks on the category he wishes, and magic category appears below

Step2 (a): If the user clicks on another category (eg headers), the category shown above disappears and the new displays (always in this example, signatures headers disappear and appear )

For part of what appears, sql queries are functional, they are no problems.
As against that plot thickens when the famous "I click on the image and the corresponding displayed creations".

A friend told me to do so with the click () method and using the property display in a div (each category containing a div), but being a beginner deep js and after some research, I still do not understand at all. Can anyone help me please?
Reply With Quote
  #2  
Old 15-04-2009
Ashok.M's Avatar
Member
 
Join Date: Feb 2008
Posts: 194
Re: Need help to show/hide div

Your friend is right. But first you must know all classes are loaded into the source code when you view the page, where you want to retrieve them click?
Reply With Quote
  #3  
Old 15-04-2009
Nutty's Avatar
Member
 
Join Date: Feb 2008
Posts: 1,267
Re: Need help to show/hide div

I suppose, all classes loads in the source code to display the page
Reply With Quote
  #4  
Old 15-04-2009
Ashok.M's Avatar
Member
 
Join Date: Feb 2008
Posts: 194
Re: Need help to show/hide div

So we need every category is in a DIV which is not displayed by default (display: none). In PHP, $ cat_id is the number one category.

Code:
<div style="display: none;" id="cat_id_<?=$cat_text?>"><?=$cat_text?></div>
And for your images:
<a href="#" onclick="manage(1); return false;"><img src="" /></a>

JavaScript function manage(n) displays/hides the div ID n (with document.getElementById (n). Style.display)
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Need help to show/hide div"
Thread Thread Starter Forum Replies Last Post
MSP2010: Show/Hide Assignments klaasbob Microsoft Project 3 09-08-2011 10:10 PM
How to hide and show cursor in Visual C + + Mrigankasekhar Software Development 5 07-03-2010 12:50 AM
show/Hide playlist in Windows Media Player 11 Iesa Windows Software 3 17-02-2009 10:42 PM
How to show or hide the Recycle Bin in Windows Vista? Venator Customize Desktop 3 13-01-2009 12:39 PM
Hide or Show Libraries in the Navigation Pane of Windows 7 Explorer WindowsGeek Tips & Tweaks 1 05-01-2009 05:56 PM


All times are GMT +5.5. The time now is 02:54 PM.