How to include Jquery plugin in Drupal?
I was wondering if the开发者_StackOverflow社区re is any recommended way of adding a Jquery plugin to Drupal 7 or it should be done by adding code to the main template file?
http://drupal.org/node/1043478#comment-4018128 explains how you can add it to your themes .info file.
If the plugin is only being used on certain pages of the site and not throughout, you might want to consider adding it only to those pages that need it via drupal_add_js
for optimal performance.
You can add a Jquery plugin in main template file using script tags or specify the relevant file in .info and keep it in the local directory js of your theme
精彩评论