- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Tooltip Not Working On JS
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”
How are you displaying the tooltip?..I think that’s the JS we need to see.
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.
The inserted HTML might be identical and so the tooltip JS must be the issue.
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
Thanks all for advice.