Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JS and qtip noob question
4th June, 15:19 (This post was last modified: 4th June 15:20 by ArnMan.)
Post: #1
JS and qtip noob question
I am okay with PHP, html, css, and mysql.
When it comes to js and qtips, i am just not able to get the hang of it.

I am running a php site with mysql, html, css.
Most of the information comes from the database.
I have images on there that I would like to have a qTips info screen popup on.
the pic and pic description are in the database
I have downloaded the qtips and put the js in mysite.com/tips folder and the css in the mysite.com/css folder.

Lets say for example I have a img

HTML Code
<img src="../images/goodpic.jpg">


and that shows a image on the page.

How do I add qtips to that, after reading the database to get the proper info?

also in some places I have a php function that when called performs a database query, and echo's a image back to the php page.
example
in my index.php
PHP Code
<div class="indexpageyouareherepic">
OUT;
locpic();
print <<<OUT
</div>


and here is the function in my globalfunction.php to look for the goodpic.jpg and echo it back into main page

PHP Code
function locpic()
{
global $ir, $db;
 
$lp=$db->query("SELECT * FROM cities WHERE cityid ={$ir['location']}");
$lp1 = mysql_fetch_array( $lp );
			$lpi = "<img src='../images/{$lp1['locpic']}'>";	
	echo $lpi;
 
}


How do I implement qitps into what i have? I want to add a description of the picture in a tip when i mouseover.
Remember I am noob and am clueless Tongue
Find all posts by this user
Quote this message in a reply
5th June, 10:28
Post: #2
RE: JS and qtip noob question
Well first you'll need to add the description to the image element in some way, perhaps the alt tag would be appropriate. Then use something similar to the following:
JS Code
$('img[alt]').qtip({
	content: {
		attr: 'alt'
	}
});

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
  qTip2 themeroller question gmilby 1 30 14th May 17:50
Last Post: Craig
  [Solved] loadContent method DATA question oli.G 1 876 22nd August 18:51
Last Post: Craig
  [Solved] Newbie Question vballGuy 4 769 31st March 01:37
Last Post: vballGuy
  [Solved] I must be doing something really wrong: very basic question tsutu 2 579 27th March 17:56
Last Post: tsutu
  [Solved] Should be simple question gtppopzz 9 1,128 24th January 18:54
Last Post: Craig
  [Solved] Positioning question olaw 1 727 8th December 15:26
Last Post: Craig
  Qtip position question - Please help win 3 2,002 28th August 15:20
Last Post: Craig
  A newbee Question insideout 1 1,280 7th April 15:33
Last Post: linusx
  [Solved] Question about HTML rendering of content fchristant 0 751 27th February 11:20
Last Post: fchristant
  Modal tooltip question dre1080 0 958 18th February 18:20
Last Post: dre1080



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