Results 1 to 5 of 5

Thread: ddimgtooltip - roll over positioning

  1. #1
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default ddimgtooltip - roll over positioning

    1) Script Title: ddimgtooltip

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...agetooltip.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.

    Code:
    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?

    Code:
    y=(y+tiph>$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y
    Thanks in advance

    Lee

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

    Default

    There are a couple of ways to do this depending on where exactly you wish the tooltip to be shown relative to the anchor. But one quick way to anchor the tooltip once the mouse rolls over the anchor link is to comment out the below line inside the .js file:

    Code:
    				$target.mousemove(function(e){
    					//var $tooltip=$("#"+this._tipid)
    					//ddimgtooltip.positiontooltip($, $tooltip, e)
    				})
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    Lee540 (10-03-2011)

  4. #3
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply.

    This has helped, however it wasn't entirely what I meant sorry.

    How do I get all tool tips to appear in the same location on a page regardless of where the link is positioned?

    Thanks

    Lee
    Last edited by Lee540; 10-10-2011 at 09:14 AM.

  5. #4
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    If this is possible?

  6. #5
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Admin?

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
  •