简体   繁体   中英

Options in the jquery-ui tooltip function does not having any affect on tooltip

I am trying to add a jQuery-ui tooltip to my rails application.

By following the given example, I configured my javascript. I am trying to use below mentioned two options. But none seems working.

$(document).tooltip({
    track: true,
    position: { 
      my: "center", 
      at: "center bottom" 
    }
  });

I got a tooltip but it was very simple tooltip with a simple black background and the options i specified was not making any affect on tooltip.

Can you post a jsfiddle or codepen of this issue? Would be happy to try to help you. This should work if your item has a tooltip class:

$(".tooltip").tooltip({
    track: true,
    position: { 
      my: "center", 
      at: "center bottom" 
    }
});

Make sure also that the title attribute is set on the tooltip item or you set content: "" in your .tooltip({}); options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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