0

How to use multiple jQuery Plugins in one File? I have to use jCarousel and Lightbox plugin both together in a file of php. the jCarousel is working fine for the light box all paths are correct but it always says that

$("#gallery a").lightbox is not a function. 

Same as for fancy box or how do I can use Lightbox2 of prototype with jQuery.

I used the below for no confliction

var $jx = jQuery.noConflict();
$jx(function() {
  $jx(".jgallery").jCarouselLite({
     btnNext: ".morePost",
     visible: 8,
     scroll:8   
  });

for using with prototype. The Prototype Light Box Start working but jCarousel does not work after this.

3

2 Answers 2

2

Allow me to suggest a different alternative here. If you're including Prototype just for the lightgox, don't :)

There's a jQuery version of the lightbox plugin, this will save you the weight on the user's download of 1/2 libraries. Just use the jQuery version here: http://avioli.github.io/jquery-lightbox/

There are a few variations out there, but no need to include 2 major JavaScript libraries that share similar plugins, just choose one and use the version of plugins that are built on it.

Sign up to request clarification or add additional context in comments.

Comments

0

You can use a compiler to combine all your javascripts in one file. Famous ones are

Select your poison of choice. There are others you may want to investigate, even open source solutions that you can embed in your projects

1 Comment

I have to use jcarasoul and Lightbox plugin both together in a file of php. the Jcarasoul is working fine for the light box all paths are correct but it always says that $("#gallery a").lightbox is not a funtion. Same as for fancy box or how do I can use Lightbox2 of prototype with jQuery. I used the below for no confliction var $jx = jQuery.noConflict(); $jx(function() { $jx(".jgallery").jCarouselLite({ btnNext: ".morePost", visible: 8, scroll:8 }); for using with prototype. The Prototype Light Box Start working but Jcarasoul not work after this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.