javascript - Twitter bootstrap:Popop are not showing up on first click but show up on second click -
here code. please me
$(document).ready(function(){ $(document).delegate(".view","click",function(){ var id = $(this).attr("id"); alert(id); $("#"+id).popover({ html : true, content: function() { return $("#"+id+"tt").html(); }, title: function() { return $('#popovertitle').html(); } }); alert("thisa"); });
});
try replacing function .delegate() .on(), function has been superseded in last versions of jquery.
jquery 1.4.3+
$( elements ).delegate( selector, events, data, handler );
jquery 1.7+
$( elements ).on( events, selector, data, handler );
the code be:
$(document).ready(function(){ $(document).on("click",".view",function(){ var id = $(this).attr("id"); alert(id); $("#"+id).popover({ html : true, content: function() { return $("#"+id+"tt").html(); }, title: function() { return $('#popovertitle').html(); } }); alert("thisa"); }); });
Comments
Post a Comment