Linking existing jQuery libraries and images
Permalink
I am having trouble making some jQuery functions work on my default template. I am working under a subdomain called 'dev'
I have the code as:
I also have a bunch of images in an image folder on the server but they are not being pulled onto the page.
I use the path images/bob_photo.jpg etc
Also can't get autonav to use lightboxes but that is another forum thread...
I have the code as:
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="../js/jquery.bgpos.js"></script> <script type="text/javascript" src="../shadowbox/shadowbox.js"></script>
I also have a bunch of images in an image folder on the server but they are not being pulled onto the page.
I use the path images/bob_photo.jpg etc
Also can't get autonav to use lightboxes but that is another forum thread...
To further clarify tallacman's response...
First of all, don't include jquery because c5 already does that automatically (so you only need the 2nd and 3rd of your scripts included).
Second, you need to insert the code "<?php echo $this->getThemePath(); ?>" in your src's instead of the "..", so:
(that is assuming the jquery.bgpos.js file is inside a folder called "js" in your theme directory, and shodowbox.js is inside a folder called "shadowbox" in your theme directory)
Finally, you need to do a similar thing with the images in order for them to load:
(assuming the image is inside a folder called "images" in your theme directory)
One exception to the above rule -- if you are referring to images from your CSS file (e.g. "background: url(myimage.jpg)"), then you do NOT use the php code -- you just use the normal "../images/myimage.jpg" thing.
Hope that helps!
-Jordan
First of all, don't include jquery because c5 already does that automatically (so you only need the 2nd and 3rd of your scripts included).
Second, you need to insert the code "<?php echo $this->getThemePath(); ?>" in your src's instead of the "..", so:
(that is assuming the jquery.bgpos.js file is inside a folder called "js" in your theme directory, and shodowbox.js is inside a folder called "shadowbox" in your theme directory)
Finally, you need to do a similar thing with the images in order for them to load:
<img src="<?php echo $this->getThemePath(); ?>/images/myimagename.jpg" />
(assuming the image is inside a folder called "images" in your theme directory)
One exception to the above rule -- if you are referring to images from your CSS file (e.g. "background: url(myimage.jpg)"), then you do NOT use the php code -- you just use the normal "../images/myimage.jpg" thing.
Hope that helps!
-Jordan
For the correct way I highly recommend visiting Weblicating's web site here:http://www.weblicating.com/c5/cheat-sheet/... where all will become known.
Steve