Results 1 to 4 of 4

Thread: StickyTooltip left click

  1. #1
    Join Date
    Oct 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question StickyTooltip left click

    Hi,

    Script: DD Tab Menu
    http://www.dynamicdrive.com/dynamici...ckytooltip.htm

    I've been trying to use this script to display persistent information on a map. However, I have to display the tooltip on left click not right click. What changes do I need to make? I tried fiddling with it but it's a bit over my head.

    Map here: http://candelascommunity.businesscat...s-reservations


    Thanks!

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    not extensively tested, but seems to work.

    take this:
    Code:
    $(this).bind("click", function(e){
    	if (e.button==0){
    		stickytooltip.isdocked=false
    		stickytooltip.hidebox($, $tooltip)
    	}
    })
    and replace it with:
    Code:
    $(this).bind("click", function(e){
    	if ( stickytooltip.isdocked ){ // to undock, instead of checking for left click, check if a tooltip is currently docked
    		stickytooltip.isdocked=false
    		stickytooltip.hidebox($, $tooltip)
    	}
    })
    Then, take this:
    Code:
    $(this).bind("contextmenu", function(e){
    	if (stickytooltip.rightclickstick && $(e.target).parents().andSelf().filter(targetselector).length==1){ //if oncontextmenu over a target element
    		stickytooltip.docktooltip($, $tooltip, e)
    		return false
    	}
    })
    and replace it with:
    Code:
    $(this).bind("click", function(e){  // bind to click instead of contextmenu
    	// and check if it is a left click
    	if (e.button==0 && stickytooltip.rightclickstick && $(e.target).parents().andSelf().filter(targetselector).length==1){ 
    		stickytooltip.docktooltip($, $tooltip, e)
    		return false
    	}
    })
    jsfiddle

  3. #3
    Join Date
    Oct 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you m8, you're a life saver!

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

Similar Threads

  1. left click to save as
    By imSOmusic in forum PHP
    Replies: 7
    Last Post: 07-11-2010, 07:56 PM
  2. how to disable left click in lightbox?
    By rm_dynamicdrive in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-10-2009, 06:14 PM
  3. Silent no LEFT click
    By Gabber in forum Dynamic Drive scripts help
    Replies: 10
    Last Post: 09-07-2008, 05:59 AM
  4. silent left & right click for images only
    By swimmyz in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 09-06-2008, 03:09 AM
  5. Left mouse click no alert
    By marcel_04 in forum Looking for such a script or service
    Replies: 0
    Last Post: 04-24-2008, 10:40 AM

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
  •