Forums

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

Home Forums JavaScript Tooltip Not Working On JS

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #192524
    wolfgang1983
    Participant

    When I add a new row by clicking on the add new row button.

    The image should show a tool tip.

    For some reason it only shows on the very first image.

    It should display on other images when add new rows. How can I add it to make it work with my js.

    Codepen Link “http://codepen.io/riwakawebsitedesigns/pen/RNKNom”

    http://codepen.io/riwakawebsitedesigns/pen/RNKNom

    #192527
    Paulie_D
    Member

    How are you displaying the tooltip?..I think that’s the JS we need to see.

    #192534
    wolfgang1983
    Participant

    If you look on the JavaScript html += image you will see its the, same as whats on the HTML section. Bit strange that tooltip only works for the first row only and not any add rows.

    #192539
    Paulie_D
    Member

    The inserted HTML might be identical and so the tooltip JS must be the issue.

    #192545
    Podders
    Participant

    Your initializing the tooltip plugin on page load when only one image tooltip exists, when you add the new row, the tooltip plugin will not apply to the newly added content,

    With the tooltip plugin you can atatch the tooltip to the body and pass a seletor as an option to be able to attatch the tooltip to newly added elements that match the selector,

    $(function(){
      $('body').tooltip({
        selector: '[rel=tooltip]'
      });
    });
    

    Check out http://codepen.io/Podders/pen/myReXj

    #192599
    wolfgang1983
    Participant

    Thanks all for advice.

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