Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the info in the qtip
16th June, 14:38
Post: #1
Using the info in the qtip
Hi, first of all great job on the plugin, its awesome!
But i have a little question.

I want to use the info for a autocomplete, so that when its clicked to put the info in my input field.
JS Code
<script type="text/javascript">
		$(document).ready(function(){
 
			$('.tTip').qtip({
 
			   content: {
				  text: function(api) {
					 // Retrieve content from custom attribute of the $('.selector') elements.
					 return $(this).attr('title');
				  }
				  },
				  hide: {
					  event: 'unfocus'
				   }
				});
 
				$('ui-tooltip-content > span.clickable').click(function(){
				var text=$(this).text();
				$('input').val(text);
				});
		});
	</script>


HTML Code
<input type="text" class="autocoplete tTip" title="<span class='clickable'>ads</span>" />

but when i click the info nothing happends Sad can you give a hand?
Find all posts by this user
Quote this message in a reply
16th July, 20:35
Post: #2
RE: Using the info in the qtip
Don't stick HTML inside the title attribute, use an ID'd element and pass that as the content via jQuery object instead. Also note that content functions are executed for every tooltip show! Don't use one if that's not what you intend or the content doesn't change regularly.

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
13th December, 01:27
Post: #3
RE: Using the info in the qtip
Thanks for this code i try to used this info...


_________________
datacenter
Find all posts by this user
Quote this message in a reply
Post Reply 




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