views:

22

answers:

2

How to use multiple jQuery Plugins in one File? 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.

A: 

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

samy
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 conflictionvar $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.
junjua
A: 

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://leandrovieira.com/projects/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.

Nick Craver