Results 1 to 4 of 4

Thread: Need help to show/hide div

  1. #1
    Join Date
    Feb 2008
    Posts
    1,260

    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?

  2. #2
    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?

  3. #3
    Join Date
    Feb 2008
    Posts
    1,260

    Re: Need help to show/hide div

    I suppose, all classes loads in the source code to display the page

  4. #4
    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)

Similar Threads

  1. Show/Hide group symbols via shortcut in Excel
    By Saddys in forum MS Office Support
    Replies: 2
    Last Post: 16-02-2012, 07:19 PM
  2. MSP2010: Show/Hide Assignments
    By klaasbob in forum Microsoft Project
    Replies: 3
    Last Post: 09-08-2011, 10:10 PM
  3. How to hide and show cursor in Visual C + +
    By Mrigankasekhar in forum Software Development
    Replies: 5
    Last Post: 07-03-2010, 12:50 AM
  4. show/Hide playlist in Windows Media Player 11
    By Iesa in forum Windows Software
    Replies: 3
    Last Post: 17-02-2009, 10:42 PM
  5. How to show or hide the Recycle Bin in Windows Vista?
    By Venator in forum Customize Desktop
    Replies: 3
    Last Post: 13-01-2009, 12:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,079,423.33785 seconds with 16 queries