Linking/unlinking jquery object to an element

前端 未结 3 1215
别跟我提以往
别跟我提以往 2021-01-06 01:52

I\'m using a jquery flowplayer tools plugin http://flowplayer.org/tools/tooltip.html

1)I want a tooltip to be created when user clicks on an element.

2)When

3条回答
  •  情话喂你
    2021-01-06 02:21

    jQuery tools tooltip supports defining which events trigger the tooltip.

    You do not need to handle the click event by yourself.

    Edit: Updated the script. Click on the link to move the tooltip to the second element always.

    Here is the script

    var tt = $("h1").tooltip({
      events:{def:'click, click'},
      effect: "slide",
      tip: '.tooltip' ,
      position: "bottom center",
      api: true,
      delay: 30000
    });
    
    $("#ht").click(function() {
      tt.hide();
      $("#_2").tooltip().show();
    });
    

    The whole script

    
    
    
    
    
    
    
    JS Bin
    
    
    
    
    
    
    
        

    John

    Mary

    Dan

    Paul

    Kim

    Click here
    There should be only one tooltip on a page!

提交回复
热议问题