Since jQuery $(document).ready only fires once. My Twitter bootstrap tooltips break on changing of pages.
I currently use something simple like below to initialize my tooltips:
$(function () {
// for tooltips
$('body').tooltip({
selector: '[rel=tooltip]'
});
});
Is there a better way to go about this?
Found the answer!
var ready;
ready = function() {
...your javascript goes here...
};
$(document).ready(ready);
$(document).on('page:load', ready);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.