简体   繁体   English

为什么第一次单击时qtip工具提示未显示弹出,从第二次单击开始,提示工具提示

[英]why qtip tool tip is not showing pop up on first click ,from second click its showing the tool tip

UPDATED Question :: its working from left click on the node ,inaddtion to that from the right click also it should work for us..on right click-->properties,pop shpuld be displyed on the actual node not on right click menu..as shown below ..when i click do right click on node,i will get right click menu !when i click view properties pop up should be displayed on the nodenot on the right click menu 更新的问题::它在节点上从左键单击起工作,除右键单击外也应为我们工作。.在右键单击->属性上,弹出菜单应显示在实际节点上,而不是在右键单击菜单上。如下图所示..当我单击鼠标右键单击节点时,我将获得右键单击菜单!当我单击视图时,弹出的属性应显示在节点上而不是右键单击菜单上

在此处输入图片说明

I have 10-15 nodes in a layout,all nodes will be dynamic,on click of each node ajax call needs to be made and results of the ajax results needs to be shown using qtip tool tip.below is the code of it .on first click it is not showing the pop up but from seconf click its showing tool tip.why its not showing the pop on first click????? 我在布局中有10-15个节点,所有节点都是动态的,单击每个节点都需要进行ajax调用,并且需要使用qtip工具tip显示ajax结果的结果。下面是它的代码。第一次单击它不显示弹出窗口,但是从seconf中单击其显示工具提示。为什么第一次单击时不显示弹出窗口?

    var str = "#JP"+ nodeId;

    $(str).qtip({

        content: {
            text: 'Loading...', 
            ajax: {
                url: 'url', 
                dataType : 'text',
                type: 'GET', // POST or GET
                data: {}, // Data to pass along with your 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 ) and check this demo: 尝试使用qTip2( http://qtip2.com )并检查此演示:

http://jsfiddle.net/craga89/L6yq3/ 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 as URL
                })
                .then(function(content) {
                    // Set the tooltip content upon successful retrieval
                    api.set('content.text', content);
                }, function(xhr, status, error) {
                    // Upon failure... set the tooltip content to error
                    api.set('content.text', status + ': ' + error);
                });

                return 'Loading...'; // Set some initial text
            }
        },
        position: {
            viewport: $(window)
        },
        style: 'qtip-wiki'
     });
 });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM