javascript - why qtip tool tip is not showing pop up on first click ,from second click its showing the tool tip -
updated question :: working left click on node ,inaddtion right click should work us..on right click-->properties,pop shpuld displyed on actual node not on right click menu..as shown below ..when click right click on node,i right click menu !when click view properties pop should displayed on nodenot on right click menu
i have 10-15 nodes in layout,all nodes dynamic,on click of each node ajax call needs made , results of ajax results needs shown using qtip tool tip.below code of .on first click not showing pop seconf click showing tool tip.why not showing pop on first click?????
var str = "#jp"+ nodeid; $(str).qtip({ content: { text: 'loading...', ajax: { url: 'url', datatype : 'text', type: 'get', // post or data: {}, // data pass along request success: function(data, status) { alert(data); this.set('content.text', data); },error : function(msg, url, line){ alert('msg'+ msg); } } } });
try using qtip2 (http://qtip2.com) , check demo:
http://jsfiddle.net/craga89/l6yq3/
$('a').each(function() { $(this).qtip({ content: { text: function(event, api) { $.ajax({ url: api.elements.target.attr('href') // use href attribute url }) .then(function(content) { // set tooltip content upon successful retrieval api.set('content.text', content); }, function(xhr, status, error) { // upon failure... set tooltip content error api.set('content.text', status + ': ' + error); }); return 'loading...'; // set initial text } }, position: { viewport: $(window) }, style: 'qtip-wiki' }); });
Comments
Post a Comment