Problem with Pnotify tooltip position
exactly copying source code f开发者_如何学JAVArom Pnotify project page, and put in in my page. all links to jqueryUi and Pnotiy and other relative files were done and correct. but when hovering on element for showing tooltip, toltip box goes to top-right of page;it's fixed and do not care of cursor position ! can ya help ?
$('span.required').bind({
mouseenter: function() {
var ttText = $(this).siblings('.required').html();
var ttTitle = "it's required";
tooltip = $.pnotify({
pnotify_title: ttTitle,
pnotify_text: ttText,
pnotify_hide: false,
pnotify_closer: false,
pnotify_history: false,
pnotify_animate_speed: 100,
pnotify_opacity: .9,
pnotify_notice_icon: "ui-icon ui-icon-comment",
pnotify_stack: false,
pnotify_after_init: function(pnotify){
pnotify.mouseout(function(){
pnotify.pnotify_remove();
});
},
pnotify_before_open: function(pnotify){
pnotify.pnotify({
pnotify_before_open: null
});
return false;
}
});
tooltip.pnotify_display();
},
mouseleave: function() {
tooltip.pnotify_remove();
}
});
Stacks are how you change the positioning.
- Browse to http://pines.sourceforge.net/pnotify/.
- Scroll down to "Advanced Demos".
- Examine "Examples of custom stacks" bit. Click the buttons there.
- View Source on the page to get to the code.
The tooltips do not use stacks like all the other notifications do. Instead you need to set up the position through CSS.
tooltip.get().css({
'top': event.clientY + 12,
'left': event.clientX + 12
});
精彩评论