addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

SoCal.js Message Board › ONE element?

ONE element?

Peter K.
Santa Monica, CA
Post #: 14
I notice that the examples of calling the JQuery plugin on the JQuery site allows only ONE element. Is there a way of passing TWO or MORE elements to a plugin, or do you have to wrap the plugin in a DIV, say, and use multiple CHILD elements inside of the DIV?

Or do you have to name your multiple elements so that they are selectable by some sort of JQuery select syntax?­

(function( $ ){

$.fn.myPlugin = function() {

// there's no need to do $(this) because
// "this" is already a jquery object

// $(this) would be the same as $($('#element'));

this.fadeIn('normal', function(){

// the this keyword is a DOM element


})( jQuery );

$('#element').myPlugin(); <-- ONE element
Powered by mvnForum

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy