Posted by milos1234 on March 9, 2009 at 7:09pm
Jump to:
| Project: | Hovertips and Clicktips |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hi
Just wondering if there are options to change the hovertip postion? I would like it to appear above the hover element, or above mouseposition could be ok too.
Thanks!
Comments
#1
You should be able to control this with stylesheets. So you can customize it in your theme.
I don't know off hand exactly what to change, but a little investigation and you'll find it.
#2
@dave:
i dont think its just a css thing, it looks like the position of the hovertip is handled in the javascript. i read somewhere that someone was trying to do a similar thing but i have lost the link.
#3
It displays the hovertip relative to the mouse position, not the element's position. To change how far from the mouse, you can change the margin-left and margin-top on .hovertip and .hovertip_wrap0. (I think, haven't tested)
If you want to display relative to the target element, then you have to change some javascript. Write a replacement for hovertipTargetPrepare() which replaces calls to hovertipShowUnderMouse() with another function (you'll have to write) that displays them over the target. Then pass your function to hovertipActivate, instead of hovertipTargetPrepare. May sound complicated, but it's flexible.
#4
@Dave: thanks for the hints, but changing the css is not really a suitable fix, as my hovertips are dynamic, and of varied size throughout the site. ie the bottom of the hovertip needs to align with the mouse pointer.
(Using the Glossary module with hovertips).
I think i will have to go in and try and mong the javascript. :)
#5
I would love to know if this was successful and how it was done.
Thanks.
#6
dirty fix:
Line 64 hovertip.js: + var hovertipMouseW;Line 69 hovertip.js: + hovertipMouseW = mouse[2];
Line 85 hovertip.js: + var width = window.innerWidth || (window.document.documentElement.clientWidth || window.document.body.clientWidth);
Line 111 hovertip.js: + return [xcoord, ycoord, width]; /* replace by this */
Line 235 hovertip.js: + 'left': ((hovertipMouseX+elwidth) > hovertipMouseW )?(hovertipMouseX-elwidth):hovertipMouseX + 'px'}) /* replace by this */
move the Hovertip to left of the Mouse Cursor if Hovertip cause Content to scroll.