Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Apr 2013
    Posts
    72
    Member #
    36068
    Liked
    1 times
    I'm trying to incorporate this jquery into my website navigation for hiding/showing stuff - it works, but I'm not sure how to have multiple versions of this on the same page that donít affect each other.
    For example two menus that use this technique independently and donít interfere with each other. How do I do this?

    If I can get that to work Ė would there be any issue with having a second indecently working menu within one that is revealed?

    here is where the instructions are, the javascript itself is below:
    http://www.randomsnippets.com/2011/0...comment-223979



    function showonlyone(thechosenone) {
    $('.newboxes').each(function(index) {
    if ($(this).attr("id") == thechosenone) {
    $(this).show(200);
    }
    else {
    $(this).hide(600);
    }
    });
    }

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Give the second set a different class. Currently, it looks like the existing one has "newboxes" as a class. Give the second one it's own class, and put it in another copy of the jquery script.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Member
    Join Date
    Apr 2013
    Posts
    72
    Member #
    36068
    Liked
    1 times
    I tried that, but when I put in another query script neither of them work

  5. #4
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    You'll also have to change the name of the function. My bad, forgot to mention it.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  6. #5
    Member
    Join Date
    Apr 2013
    Posts
    72
    Member #
    36068
    Liked
    1 times
    Oh okay, thanks that worked!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:27 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com