Hello,

I have a theme that shows a preview of the image that the mouse is
currently hovering over with a larger image using jquery tooltip.

The problem is that it always places the preview on the right and if
the image is on the right side of the page the preview causes
horizontal scrolling,

see for yourself:

http://torontopersonalinjurylawyers.org

Is it possible make the preview switch to the left side of the mouse
if the mouse if on the right side of the page (ie. past a certain
point in the x-axis),


Somebody posted this code as a solution but I have not been able to
implement it:

-----------------------------------------------------------------------
Thanks a lot of the extremely useful script!

To position the tooltip depending where you are, you need to rewrite
some of the code using the offset() property of jQUERY.

var toolTipPosition = $(this).offset(); //Declare the Offset object
var offsetX = 0;
var offsetY = 0;
//Then in the hover property
$("#tooltip")
.css("top",( toolTipPosition.top - posiY) + "px")//Will set where the
link/thumbnail is horizontally
.css("left",( toolTipPosition.left + this.offsetWidth/2 + posiX) +
"px") /*Will be positioned to the middle of the link/thumbnail, you
can alway remove this.offsetWidth/2 to remove the middle placement
thing.*/
//Remove the mouseover function and your set!

.fadeIn("fast");
-----------------------------------------------------------------------



Thanks.

Reply via email to