开发者

Show information near mouse pointer problem

开发者 https://www.devze.com 2023-03-17 12:05 出处:网络
I hava available JQuery and Dojo and I need to display info near mouse pointer (like tooltip). To be more clear, I have Dojo slider and while user sliding I need to show around m开发者_StackOverflowou

I hava available JQuery and Dojo and I need to display info near mouse pointer (like tooltip). To be more clear, I have Dojo slider and while user sliding I need to show around m开发者_StackOverflowouse like tooltip some info ( hours and minutes ). How to solve this ? Is there any already done functions for this in Dojo or Jquery or JavaScript ?


JQUERY UI POSITIONING

http://docs.jquery.com/UI/Position

This is the perfect api to get your job done.Add a label in page in body any where initially hidden and in onchange event simply position it along your mouse pointer and with the updated text content.Thats what i did.

Make sure it is absolute position

$(document).mousemove(function(ev){

$("#position4").position({ my: "left bottom", of: ev, offset: "3 -3", collision: "fit" }); });

This code will actually add the reference div on mouse position every time but you can customize it as your requirement

0

精彩评论

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

关注公众号