Results 1 to 6 of 6
Hybrid View
-
20th Oct 2010, 04:27 PM #1MemberWebsite's:
th3fallen.comi notice that your jquery doesnt load from document ready, that could the problem but i usually try to stay away from onclick actions for tool tips
what i would do is something like this...
Code:$(document).ready(function() { //Tooltips $(".tip_trigger").hover(function(){ tip = $(this).find('.tip'); tip.show(); //Show tooltip }, function() { tip.hide(); //Hide tooltip }).mousemove(function(e) { var mousex = e.pageX 20; //Get X coodrinates var mousey = e.pageY 20; //Get Y coordinates var tipWidth = tip.width(); //Find width of tooltip var tipHeight = tip.height(); //Find height of tooltip //Distance of element from the right edge of viewport var tipVisX = $(window).width() - (mousex tipWidth); //Distance of element from the bottom of viewport var tipVisY = $(window).height() - (mousey tipHeight); if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport mousex = e.pageX - tipWidth - 20; } if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport mousey = e.pageY - tipHeight - 20; } //Absolute position the tooltip according to mouse position tip.css({ top: mousey, left: mousex }); }); });
Code:<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
Code:.tip { color: #fff; background:#1d1d1d; display:none; /*--Hides by default--*/ padding:10px; position:absolute; z-index:1000; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
Code:<a href="#" class="tip_trigger">Your Link Key Word <span class="tip">This will show up in the tooltip</span></a>
th3fallen Reviewed by th3fallen on . jQuery tooltip help :S Hi ! I am currently using jquery tooltip to replace the ordinary title attributes and it is quite well,but there is only one problem : tooltips do not update in time.. Lets say i have : <img src=balba.jpg title='not clicked' onclick=this.title='clicked'> .. Simply when user clicks the image the tooltip does not change to 'clicked' and stays 'not clicked' :S Anyone can give me a script ? Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
JQuery and RegExr Help :|
By Porsche_maniak in forum Web Development AreaReplies: 4Last Post: 1st Jun 2012, 12:26 AM -
[Hiring] Coder with exp in DLE, jquery
By newshit in forum Completed TransactionsReplies: 0Last Post: 11th Jan 2012, 09:42 PM -
JQuery help
By xElliex in forum Web Development AreaReplies: 5Last Post: 25th Aug 2011, 10:38 PM -
jQuery tooltip help
By devilzkrazy in forum Technical Help Desk SupportReplies: 0Last Post: 22nd May 2010, 04:24 PM -
Introduction to jQuery
By litewarez in forum Tutorials and GuidesReplies: 4Last Post: 14th Jan 2010, 02:51 AM
themaCreator - create posts from...
Version 3.53 released. Open older version (or...