开发者

jQuery flowplayer tooltip: two tooltips on a single element

开发者 https://www.devze.com 2023-02-13 03:37 出处:网络
I am using jQuery tooltip included in flowplayer jQuery tools. I have a requirement where I want to attach two tooltips on a single element. One when I click on the element, another when I receive res

I am using jQuery tooltip included in flowplayer jQuery tools. I have a requirement where I want to attach two tooltips on a single element. One when I click on the element, another when I receive response from an ajax request. Here's what I'm trying...

HTML Code is:

<div id="myelement"></div>

<div id="#tooltip1">This will delete your data.</div>
<div id="#tooltip2">Your data has been deleted.</div>

JS Code to add the tooltip and make request is:

$('#myelement').tooltip({
    events: {
        def: 'click, mouseleave'
    },
    tip: '#tooltip1'
});
$('#myelement').tooltip({
    events: {
   开发者_C百科     def: 'customOpenEvent, mouseleave'
    },
    tip: '#tooltip1'
});

$.ajax({
    url: 'abc.php',
    dataType: 'json',
    data: {
        item:'new'
    },
    success: function(data) {
        if (data.success == 'yes') {
            // Display the new tooltip here
            $('#myelement').trigger('customOpenEvent');
        }
    }
});

What am I missing here? Is it even possible to assign two tooltips to a single element?

0

精彩评论

暂无评论...
验证码 换一张
取 消