Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] [Solved] How to make the whole tooltip clickable?
28th January, 11:10
Post: #1
[Solved] [Solved] How to make the whole tooltip clickable?
Hello,

I've been playing with qtip for few days, i searched on the site and on the forum but found nothing about:

how to make the tooltip clickable?


I would like to click anywhere on the tooltip and redirect in a new page (_blank)

Thank you Smile
Find all posts by this user
Quote this message in a reply
28th January, 11:43
Post: #2
RE: How to make the whole tooltip clickable?
Use the onRender callback to apply a click event to it Smile

JS Code
$('.selector').qtip({
	api: {
		onRender: function() {
			$(this.elements.tooltip).click(function() {
				window.location = 'http://google.com';
			});
		}
	}
});

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
29th January, 10:30
Post: #3
RE: [Solved] How to make the whole tooltip clickable?
Thank you Craig ^^
Find all posts by this user
Quote this message in a reply
3rd February, 11:05
Post: #4
RE: [Solved] [Solved] How to make the whole tooltip clickable?
Hello again, i tried since you gave me the api code. And couldn't get it working. So i am turning back to you, again Smile
JS Code
$(document).ready(function() {
 
                $('#qtip').qtip({
                    content:  {
					text: '<b>Garantie :</b>', 
 
		},
					hide: 'unfocus',
                    position: {
					corner: {
					target: 'leftMiddle',
					tooltip: 'rightMiddle'
			}
	},
                    style: {
					background: '#D3000D',
					color: 'black',
					width: { max:'400' },
					tip:{
					corner: 'rightMiddle'
					},
					border: {
					width: 7,
					radius: 5,
					color: '#8f0009'
   },
   }
					api: {
      					onRender: function() {
       					$(this.elements.tooltip).click(function() {
            				window.location = 'http://google.com';
         }
      }
   });
                });
            });
 
        </script>



Thank you Big Grin
Find all posts by this user
Quote this message in a reply
3rd February, 13:54
Post: #5
RE: [Solved] [Solved] How to make the whole tooltip clickable?
Watch our for trailing commas, and try to keep the code structured with proper indentation, makes it a lot easier to spot mistakes in brackets etc.

JS Code
$(document).ready(function() {
	$('#qtip').qtip({
		content:  {
			text: '<b>Garantie :</b>'
		},
		hide: 'unfocus',
		position: {
			corner: {
				target: 'leftMiddle',
				tooltip: 'rightMiddle'
			}
		},
		style: {
			background: '#D3000D',
			color: 'black',
			width: { max:'400' },
			tip: {
				corner: 'rightMiddle'
			},
			border: {
				width: 7,
				radius: 5,
				color: '#8f0009'
			}
		},
		api: {
			onRender: function() {
				$(this.elements.tooltip).click(function() {
					window.location = 'http://google.com';
				});
			}
		});
	});
});

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Make qTip draggable Hesostein 1 1,071 8th February 18:17
Last Post: Craig



User(s) browsing this thread: 1 Guest(s)