Lee540
09-01-2011, 03:21 PM
1) Script Title: ddimgtooltip
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm
3) Describe problem: Unable to get rollover pop-up image to appear in the same place on the page, regardless of where the text is located on that page.
I have this so far, and its works to get the image always in the same place relating to the x-axis.. when I try to setup the y-axis the image drops to the bottom of the page and it makes no difference which value I enter.
This is what I have so far, this is correct for x-axis, but y-axis still follows the mouse.
positiontooltip:function($, $tooltip, e){
var x=e.pageX+this.tooltipoffsets[0], y=e.pageY+this.tooltipoffsets[1]
var tipw=$tooltip.outerWidth(), tiph=$tooltip.outerHeight(),
x=(x+tipw>$(document).scrollLeft()+$(window).width())? x-tipw-(ddimgtooltip.tooltipoffsets[0]*2) : $(document).scrollLeft()+$(window).width()-tipw-10
y=(y+tiph>$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y
$tooltip.css({left:x, top:y})
What do I need to change this to, in order to lock its position in the y-axis?
y=(y+tiph>$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y
Thanks in advance
Lee
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm
3) Describe problem: Unable to get rollover pop-up image to appear in the same place on the page, regardless of where the text is located on that page.
I have this so far, and its works to get the image always in the same place relating to the x-axis.. when I try to setup the y-axis the image drops to the bottom of the page and it makes no difference which value I enter.
This is what I have so far, this is correct for x-axis, but y-axis still follows the mouse.
positiontooltip:function($, $tooltip, e){
var x=e.pageX+this.tooltipoffsets[0], y=e.pageY+this.tooltipoffsets[1]
var tipw=$tooltip.outerWidth(), tiph=$tooltip.outerHeight(),
x=(x+tipw>$(document).scrollLeft()+$(window).width())? x-tipw-(ddimgtooltip.tooltipoffsets[0]*2) : $(document).scrollLeft()+$(window).width()-tipw-10
y=(y+tiph>$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y
$tooltip.css({left:x, top:y})
What do I need to change this to, in order to lock its position in the y-axis?
y=(y+tiph>$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y
Thanks in advance
Lee