Active
Project:
jQuery plugins
Version:
6.x-1.5
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
27 Feb 2009 at 15:34 UTC
Updated:
6 Mar 2009 at 19:50 UTC
Hello, I'm new with Drupal. I'm trying to use Jquery plugins (for example Colorize - jQuery Table Plugin). Is there a complete example of integration Jquery plugins into a page? Where do I found it?
Thanks a lot Andrea
Comments
Comment #1
mfbYou should look for contrib modules that use a jQuery plugin and see how they do it. One random example would be slideshow_creator. Usually it's just a matter of including the plugin in the page with a function like drupal_add_js() along with adding some custom javascript that uses the plugin
Comment #2
drupania commentedmfb is right about using drupal_add_js() method to include your jquery plugins along with your other javascript files. The jquery.js file that comes with your drupal installation is found in /misc directory. Drupal bootstrap includes the jquery.js file for your so you only need to worry about including your jquery plugin in the right place. There are a few places where you can include your plugin such as a .info file, in your theme hooks and pages and in template.php file on the top of the page. There are pros and cons for each that I am still trying to get a good handle on. If you want a good resource, check out the book 'Pro Drupal Development' by by John K. VanDyk. It has a small chapter on jquery and AJAX integration. I just came across it this morning, it is very informative.
good luck