jquery - Why do I get this error? TypeError: $popover.data(...) is undefined -
what causing error onhover? error is:
typeerror: $popover.data(...) undefined.
$(function () { var overpopup = false; $('[rel=popover]').popover({ trigger: 'manual', placement: 'bottom' // replacing hover mouseover , mouseout }).mouseover(function (e) { // when hovering on element has popover, hide // them except current 1 being hovered upon $('[rel=popover]').not('#' + $(this).attr('id')).popover('hide'); var $popover = $(this); $popover.popover('show'); // set flag when move button popover // dirty way think of prevent // closing popover when navigate across // white space between 2 $popover.data('popover').tip().mouseenter(function () { overpopup = true; }).mouseleave(function () { overpopup = false; $popover.popover('hide'); }); }).mouseout(function (e) { // on mouse out of button, close related popover // in 200 milliseconds if you're not hovering on popover var $popover = $(this); settimeout(function () { if (!overpopup) { $popover.popover('hide'); } }, 200); }); }); <a href="#" id="example1" class="btn large primary" rel="popover" data-content="example 1!!!" data-original-title="example 1 title">button 1</a> <a href="#" id="example2" class="btn large primary" rel="popover" data-content="example 2!!!" data-original-title="example 2 title">button 2</a> <a href="#" id="example3" class="btn large primary" rel="popover" data-content="example 3!!!" data-original-title="example 3 title">button 3</a>
this error because either using older version of jquery
library or have not loaded angularjs
library. thought not other reason error.
Comments
Post a Comment