6 Replies - 1509 Views - Last Post: 07 February 2013 - 08:35 PM

#1 troyb408  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 18-August 12

jquery guide

Posted 07 February 2013 - 07:47 PM

Hi - I'm extremely new to jquery plugins and I'm having a hard time trying to go through a few examples of the current book I'm reading in order to get them to work. If anybody could point me in the right direction well just explain how plug ins work and are called that would be great. What did I do wrong because I'm just not seeing it.

<script type="text/javascript" src="jquery library/jquery.colorbox.js"></script>
<link type="text/css" media="screen" rel="stylesheet" href="css library/colorbox.css">
<script type="text/javascript" src="jquery library/jquery.js"> </script>

<script type="text/javascript">
$(document).ready(function()
{


$(‘a’).colorbox();
 


});
</script>

</head>

<h1>Replacing</h1>

<body>


<a href=”content/daisy.jpg”> Click me </a> .......



Thanks

Troy

This post has been edited by Dormilich: 07 February 2013 - 11:22 PM
Reason for edit:: please use [code] [/code] tags when posting code


Is This A Good Question/Topic? 0
  • +

Replies To: jquery guide

#2 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,906
  • Joined: 30-April 10

Re: jquery guide

Posted 07 February 2013 - 08:04 PM

<script ... src="jquery library/jquery.js">

There is a space in the src between "jquery" and "library/".

This post has been edited by laytonsdad: 07 February 2013 - 08:07 PM

Was This Post Helpful? 0
  • +
  • -

#3 troyb408  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 18-August 12

Re: jquery guide

Posted 07 February 2013 - 08:09 PM

I thought that was the original problem but created another test page with some simple scripts and that didnt seem to bother it. I also tried it as one word and renamed the file still nothing happened.
Was This Post Helpful? 0
  • +
  • -

#4 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,906
  • Joined: 30-April 10

Re: jquery guide

Posted 07 February 2013 - 08:16 PM

what are you using for an editor? the line $(a).colorbox(); has strange quote marks use the double quotes and try that.
Was This Post Helpful? 0
  • +
  • -

#5 troyb408  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 18-August 12

Re: jquery guide

Posted 07 February 2013 - 08:19 PM

Right now just starting off with notepad as my editor...unless you there is something easier to start learning with
Was This Post Helpful? 0
  • +
  • -

#6 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,906
  • Joined: 30-April 10

Re: jquery guide

Posted 07 February 2013 - 08:22 PM

change the quotes and then move the call to load the jquery library to the first position.

when using jquery library and plugins you want the library first.
This should work.
Was This Post Helpful? 1
  • +
  • -

#7 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,906
  • Joined: 30-April 10

Re: jquery guide

Posted 07 February 2013 - 08:35 PM

<html>
<head>
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery.colorbox-min.js"></script>

		<script type="text/javascript">
			$(document).ready(function()
			{
				$('a').colorbox();
			});
		</script>

</head>


<body>
<h1>Replacing</h1>


<a href="images/daisy.png"> Click me </a> 
</body>
</html>


This works for me.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1