Results 1 to 3 of 3

Thread: Sticky Tooltip Script Issue

  1. #1
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sticky Tooltip Script Issue

    1) Script Title: Sticky Tooltip

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ckytooltip.htm

    3) Describe problem:
    If the size of the box is too big to fit on the RIGHT of the mouse, it defaults to going to the LEFT of the mouse without regard to resizing, etc.

    What this means:
    I have a large text area that takes up about 80% of the horizontal screen space when hovered over (only 2-3 lines of vertical).
    The item that is hovered over is about 25 pixels from the left side of the screen.
    For some reason, the script thinks there is too much info to put to the right of the mouse, and puts it to the left (which is now 99% off the screen...)

    Ideas?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Are you asking how to force the script to always display to the right of the cursor, instead of to the left sometimes? If so, inside the .js file, try commenting out the below line (new addition in red):

    Code:
    //x=(x+tipw>$(document).scrollLeft()+$(window).width())? x-tipw-(stickytooltip.tooltipoffsets[0]*2) : x
    DD Admin

  3. #3
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    To the right would be a good temporary solution.
    However, ideally there would be a little more logic in the script. Instead of assuming that if it can't fit on the right, to shove it to the left... Also checking to see if it can fit on the left. If it can't fit on the left, pick the side with the most area available and size the tooltip appropriately.

    Alternatively (or additionally) it would be nice to set a "max" width of the tooltip. I would probably set a max width of 500px or so for my useage.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •