Forums

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

Home Forums JavaScript Select a with the same id in div X as an in another div Y

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #33644
    shabbirzk
    Member

    Hi

    I am trying to modify the “http://www.queness.com/post/152/simple-jquery-image-slide-show-with-semi-transparent-caption” to change images on click of each images thumbnails.

    I have set up the following framework









    So in Jquery when i select

    $(this).attr('id')

    for the id of image thumbnail clicked I now want to select the corresponding image in #slideshow

      and display it.

      Please help on the jquery code to make this selection

      #83986

      first of all it’s bad practice to reuse ID’s in multiple places on a page. switch the slideshow ones to classes and you’ve got:


      $('.slideshow .' + $(this).attr('id')).addClass('select')
      // or do whatever with it
    Viewing 2 posts - 1 through 2 (of 2 total)
    • The forum ‘JavaScript’ is closed to new topics and replies.