Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] simple test won't work?
9th October, 13:30
Post: #1
[Solved] simple test won't work?
Hi, does anyone know what I'm doing wrong here?

JS Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/stil.css" type="text/css" />
<title>Maximus</title>
 
<script type="text/javascript" src="js/poruka/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/poruka/jquery.qtip-1.0.0-rc3.min.js"></script>
 
<script type="text/javascript">
// Create the tooltips only on document load
$(document).ready(function() 
{
   // Notice the use of the each() method to acquire access to each elements attributes
   $('#content a[tooltip]').each(function()
   {
      $(this).qtip({
         content: $(this).attr('tooltip'), // Use the tooltip attribute of the element for the content
         style: 'dark' // Give it a crea mstyle to make it stand out
      });
   });
});
</script>
 
</head>
 
<body>
 
<div id="srednji">
<a href="http://en.wikipedia.org/wiki/New_York_City" tooltip="New York City">NYC</a>
</div>
 
</body>
</html>
Find all posts by this user
Quote this message in a reply
9th October, 13:35
Post: #2
RE: simple test won't work?
JS Code
$('#content a[tooltip]')

You haven't changed the selector. You don't have an element with an id of content, you have one with an id of 'srednji' though Wink

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
9th October, 16:22
Post: #3
RE: [Solved] simple test won't work?
ok tnx got it Smile
Now how can I use same method here?

JS Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/stil.css" type="text/css" />
<title>Maximus</title>
 
<script type="text/javascript" src="js/poruka/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/poruka/jquery.qtip-1.0.0-rc3.min.js"></script>
 
<script type="text/javascript">
// Create the tooltips only on document load
$(document).ready(function() 
{
   // Notice the use of the each() method to acquire access to each elements attributes
   $('#foto a[tooltip]').each(function()
   {
      $(this).qtip({
         content: $(this).attr('tooltip'), // Use the tooltip attribute of the element for the content
         style: 'dark' // Give it a crea mstyle to make it stand out
      });
   });
});
</script>
 
</head>
 
<body>
 
 
<a id="foto" href="http://www.google.com" tooltip="GALLERY"></a> 
 
</body>
</html>


CSS code for #foto element:
JS Code
#foto {
	display: block;
	width: 176px;
	height: 177px;
	margin-left: 522px;
	margin-top: -471px;
	background: url(../slike/maximus_03.gif) no-repeat 0 0;
 
}
 
#foto:hover
  { 
    background: url(../slike/max.gif) no-repeat 0 0;
  }
Find all posts by this user
Quote this message in a reply
11th October, 12:48
Post: #4
RE: [Solved] simple test won't work?
Nono, you have the change the selector so it matches some elements on your page. At the moment you're selectinG:
JS Code
/* 
 * This will select all <a/> elements with an attribute "tooltip" 
 * that are contained within an element with an ID of "foto"
*/
$('#foto a[tooltip]')

As you can see from your HTML, you don't have that structure Smile You might want to go back to basics and take a look at the Getting Started tutorial: http://docs.jquery.com/Tutorials:Getting...ith_jQuery

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
  the plugin do not work correctly with jquery 1.7? vic906 1 148 12th April 22:09
Last Post: Craig
  [Solved] Cannot get qtip to work on Ruby on Rails kakubei 5 402 3rd March 16:40
Last Post: Craig
  will qtip work in this situation seeker7805 1 243 2nd March 00:28
Last Post: Craig
  [Solved] Can't install or make it work - guide for newbie & donator marz 7 626 25th January 15:52
Last Post: Craig
  [Solved] Multi tips not 100% times work dmhorse 1 273 9th January 18:19
Last Post: Craig
  ajax.once:false option not work in IE sse.michael 2 624 9th December 01:44
Last Post: sse.michael
  [Solved] qtip does not work with wordpress version 3.1.4 zakirstage 8 808 2nd December 12:34
Last Post: zakirstage
  Qtip "tip" won't display in IE9 cmiller 1 605 21st November 00:55
Last Post: Craig
  [Solved] can't get background to work drm 2 604 21st October 20:33
Last Post: drm
  Cannot make jquery plugin or qtip plugin work anindasen 3 986 8th October 13:49
Last Post: Craig



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