Reputation: 1321
on http://www.holzschild24.com/schritt1.php i use http://leandrovieira.com/projects/jquery/lightbox/
and i get an error: $("#slider").easySlider
is not a function
Any ideas, what that can be? All files are laoded correctly, i want that when i click on a pic, i get a big version,...any ideas?
Upvotes: 0
Views: 243
Reputation: 9719
The problem you are stating comes from the file included on this line:
<script type="text/javascript" src="js/customSlide.js"></script>
Because your jQuery for adding the lightbox comes after that line the javascript has stopped because of the error, so the .lightBox()
is never added.
See it working here when you remove that line.
Alternatively add the easy slider plugin if it is actually required:
Added to the demo
Also, just so you know, in your comments for the lightbox code, you state you are adding lightbox to anchors <a...></a>
with lightbox in the rel
attribute, but you aren't your code is simply adding lightbox to all anchors!!
Due to your current HTML, you could use this as your jQuery, instead of $('a').lightBox();
$('a').each(function() {
var obj = $(this);
if (obj.children('img').size() > 0) {
obj.lightBox();
}
});
That will go through each anchor, check if the anchor is wrapping an image <img..../>
, only then will it add the .lightBox()
to the anchor.
See this working here notice your home link now act as a link, instead of opening a .lightBox()
like the first examples.
Upvotes: 2
Reputation: 5720
What is easySlider? I'm only seeing the plugin lightBox
Don't you mean $('#slider').lightBox();
Upvotes: 0