JQuery BubblePopUp does not work without warning, which works on another page

I used the jQuery Bubblepopup plugin for tooltip tips. BubblePopup is created on the mousehover by div, this div is created dynamically by the jquery append method. All jQuery functionality works fine, but it does not work without warning.

$(document).ready(function () { //alert($('#mapcontainer a.fixed').length); window.setTimeout(function () { $('#mapcontainer div.fixed').CreateBubblePopup({ position: 'top', align: 'center', divStyle: { color: '#000000', margin: '-20px 0px 0px 0px' }, innerHtml: 'Add or change location', innerHtmlStyle: { color: '#FFFFFF', 'text-align': 'center' }, themeName: 'all-grey', themePath: 'images/jquerybubblepopup-theme' }); }, 50); }); 
  • div, anchor, fixed class created by jquery append method
+4
source share
1 answer

If you use a very small number of delays, omit the setTimeOut () method and put your function directly in the ready () method.

And if you can demand some delay at runtime. Or you can increase a little more time so that the whole page loads when your code executes.

The best and most effective way is to use the document.ready () method at the end of your web page just above the body tag. Of course, this technique will solve your problem.

+2
source

Source: https://habr.com/ru/post/1387332/


All Articles