PDA

View Full Version : Image w/ description tooltip



vik101
10-01-2007, 05:31 AM
1) Script Title: Image w/ description tooltip

Hey, I would like to use the Image w/ description tooltip script but on a mapped images instead of text. Could anyone help me figure out the scripting for that? I have tried but can't figure it out. Thanks!

jscheuer1
10-02-2007, 03:02 PM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

pumakuma
10-04-2007, 04:31 AM
this script works excellently for what i am trying to do! I ran into a problem in my latest attempt though. For about 1-7 messages this script works fine.. is there something in the code that stops it from working with more than 7 messages.. the loop should take care of everything, but i'm not the best at javascript.. currently i have 17 messages setup and 4 of them used to work until i added the other 13.. now none work! any help would be greatly appreciated!! The max i have gotten working is 7, possibly something with going over 10?

http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

Thanks, Brian

jscheuer1
10-04-2007, 08:26 AM
this script works excellently for what i am trying to do! I ran into a problem in my latest attempt though. For about 1-7 messages this script works fine.. is there something in the code that stops it from working with more than 7 messages.. the loop should take care of everything, but i'm not the best at javascript.. currently i have 17 messages setup and 4 of them used to work until i added the other 13.. now none work! any help would be greatly appreciated!! The max i have gotten working is 7, possibly something with going over 10?

No. The number is virtually unlimited. I once helped a fellow with 1000's of tips. Only problem there was the length of time it took to load the script.

What you probably have is some type of syntax error that is breaking the array. The most common one's are:


Not escaping an apostrophe within a delimited value, ex:

bad:

messages[0] = new Array('red_balloon.gif','Here's a red balloon on a white background',"#FFFFFF");

good:

messages[0] = new Array('red_balloon.gif','Here\'s a red balloon on a white background',"#FFFFFF");

Leaving out a comma.
Skipping a number, ex:


messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");
messages[1] = new Array('duck2.gif','Here is a duck on a light blue background.',"#DDECFF");
messages[3] = new Array('test.gif','Test description','black','white');

djr33
10-04-2007, 08:31 AM
If there is still a problem, linking to your page will clear things up, most likely.

pumakuma
10-04-2007, 01:00 PM
I went through and check all of my messages.. only one had an apostrophe (') and i had already escaped it. the syntax is correct because i copied and pasted it from my previous ones that worked, plus i double checked (although I don't always find everything). I honestly don't see anything wrong with it.. Can I upload the messages for a double check? Could it possibly be because of the html i have inside the message? although this didn't stop the original messages from working properly..

jscheuer1
10-04-2007, 02:26 PM
Well, I did say 'probably'. It would be best if you could link us to two pages, one that works and one that doesn't. If you want to upload (attach) or paste your array to a message, I can check it. But, if the problem is something else, that won't tell me what it is. If you provide links to demo pages, I should be able to easily see any problem(s), with the arrays or otherwise.

If you choose to paste your code into a message here, use:




tags around it so that it looks like so:


code here

pumakuma
10-04-2007, 03:48 PM
http://esradio.net/cota/new%20site/webquests.php -- This one works
http://esradio.net/cota/new%20site/aboutme.php -- this one doesn't work

(Possibly a stupid mistake somewhere..)



messages[0] = new Array('','<strong>Total Hits:</strong> <div class="style2">This is the total number of times this website has been viewed by anyone (Same IP\'s)</div>','black','white');

messages[1] = new Array('','<strong>Unique Hits:</strong> <div class="style2">This is the total number of times this website has been viewed by individuals. (Separate IP\'s)</div>','black','white');

messages[2] = new Array('','<strong>Your Visits:</strong> <div class="style2">This is the total number of times this website has been viewed by you. (Your IP)</div>','black','white');

messages[3] = new Array('images/momias.jpg','<strong>Las Momias:</strong> <div class="style2">The Mummies</div>','black','white');

messages[4] = new Array('images/taos.jpg','<strong>Taos, New Mexico:</strong> <div class="style2">My HomeTown<br><br>http://www.taoschamber.com</div>','black','white');

messages[5] = new Array('images/monroe.jpg','<strong>Monroe, Louisiana:</strong> <div class="style2">Birthplace<br><br>http://www.monroe.org</div>','black','white');

messages[6] = new Array('images/stanford.jpg','<strong>Stanford University:</strong> <div class="style2">Where I got my undergraduate degree<br><br>http://www.stanford.edu</div>','black','white');

messages[7] = new Array('images/germany.jpg','<strong>Germany:</strong> <div class="style2">Parents stationed there in the Air Force:*Four Years spent here!<br><br>http://www.germany-tourism.de</div>','black','white');

messages[8] = new Array('images/unm.jpg','<strong>University of New Mexico:</strong> <div class="style2">Where I got my second bachelors and masters degrees<br><br>http://www.unm.edu</div>','black','white');

messages[9] = new Array('images/trenton.jpg','<strong>Trenton, New Jersey:</strong> <div class="style2">Second Grade!<br><br>http://www.ci.trenton.nj.us/</div>','black','white');

messages[10] = new Array('images/iowa.jpg','<strong>Sioux City, Iowa:</strong> <div class="style2">The third place I was in first grade...military base there...go ask your dad<br><br>http://www.sioux-city.org/</div>','black','white');

messages[11] = new Array('images/vegas.jpg','<strong>Las Vegas, Nevada:</strong> <div class="style2">A fun place for escape from the real world!<br><br>http://www.lasvegasnevada.gov/</div>','black','white');

messages[12] = new Array('images/mexico.jpg','<strong>Mexico:</strong> <div class="style2">yes, Mexico
Not your border towns<br><br>http://www.lonelyplanet.com/worldguide/destinations/north-america/mexico</div>','black','white');

messages[13] = new Array('images/oaxaca.jpg','<strong>Oaxaca:</strong> <div class="style2">One of the most beautiful places on earth<br><br>http://www.oaxaca-travel.com/</div>','black','white');

messages[14] = new Array('images/cancun.jpg','<strong>Cancun:</strong> <div class="style2">Great place for snorkeling<br><br>http://www.allaboutcancun.com/</div>','black','white');

messages[15] = new Array('images/guanajuato.jpg','<strong>Guanajuato:</strong> <div class="style2">Las momias....need I say more?<br><br>http://www.donquijote.org/guanajuato/</div>','black','white');

messages[16] = new Array('images/DF.jpg','<strong>DF:</strong> <div class="style2">One of the world\'s largest cities<br><br>http://www.tourbymexico.com/df/df.htm</div>','black','white');

messages[17] = new Array('images/sanmiguel.jpg','<strong>San Miguel Allende:</strong> <div class="style2">A great place to see what Europe looked like centuries ago<br><br>http://www.portalsanmiguel.com/</div>','black','white');

jscheuer1
10-04-2007, 04:19 PM
messages[12] has a line break in it. It should be:


messages[12] = new Array('images/mexico.jpg','<strong>Mexico:</strong> <div class="style2">yes, Mexico Not your border towns<br><br>http://www.lonelyplanet.com/worldguide/destinations/north-america/mexico</div>','black','white');

Not:


messages[12] = new Array('images/mexico.jpg','<strong>Mexico:</strong> <div class="style2">yes, Mexico
Not your border towns<br><br>http://www.lonelyplanet.com/worldguide/destinations/north-america/mexico</div>','black','white');

pumakuma
10-04-2007, 10:51 PM
thank you! that fixed it!