Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Manipulate Multiple Elements on a page with Jquery

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32452
    wycomm
    Member

    Here is the url: http://www.wycomm.net/customer/cav

    Once you get inside to a secondary page (say ‘solutions’) I am trying to simply change the content using AJAX via Jquery and a slide in/out animation. When a different set of content appears I am trying to simultaneously change the color of the navigation that was just clicked to the color of the hover state.

    I was thinking about using an if/else statement. Something to the tune of “if you see this id in the .content element then change color of the navigation, too”. I can’t seem to find a way to do this. Am I going about this the wrong way? Any ideas?

    #49654
    Johnnyb
    Member

    Instead of checking the content why not just change the nav button state on click? When you click a button use css(‘color’,’blue’) for example to change it’s color, and $(this).siblings().css(‘color’,’black’); to change the other links back to their default color.

    #49306
    wycomm
    Member

    That was my final option. I was hoping that there was a way to write one line of code to check what the content id was and change colors accordingly. However, if there is no way I will write the code that you suggested for each link on the navigation bar…

    #49317
    Johnnyb
    Member

    Sure. You could do that with a little bit of jQuery:




    blah blah...


    You might have to modify it a little bit and I haven’t tested it, but you can get the idea.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.