Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9107457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:34:35+00:00 2026-06-17T02:34:35+00:00

So today i decided to read something about jquery plugin development after i have

  • 0

So today i decided to read something about jquery plugin development after i have seen following examples and templates :

CSS-Tricks.com plugin template
Longpress.js

Now, i’ve got the following questions:

@Css-Tricks:

  • Why does he have a paramter named el and where is that thing ever
    initialized?
  • Why is he adding a reverse reference to the DOM object?
  • Why isn’t he using that var methods = {//...} system assumed by the
    jQuery documentation?

@longpress

  • Also, why isn’t he using the pattern from jquery offical?
  • Why isn’t he, i.e his mousewheel() method binding to the plugins
    namespace?
  • Is that all just bad practice or maybe a better way to do?

Thank you in advance

EDIT:

Down here was said that this one might be too specific. So i try to formulate it otherwise; are there problems or bad advices in the official documentation on plugin development which should be handled in other ways?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:34:36+00:00Added an answer on June 17, 2026 at 2:34 am

    I will try to answer as many questions as I can.

    The “official” jQuery pattern is only a suggestion. It illustrates best practise and is not definitive. That said, it’s so good, I use nothing else. The “supervisor” section (right at the end of the code) is seriously clever.

    CSS-Tricks

    The worst aspect of this pattern os that it puts members in both the $ and the $.fn namespaces. The former can be avoided, eg with the jQuery “official” pattern.

    el is a formal variable passed to $.yourPluginName() from $.fn.yourPluginName(), and represents, in turn, each element in the jQuery selection on which the plugin is invoked.

    I can’t quite see how the author caters for public methods of the plugin.

    LongPress

    This is a much better pattern. It puts one member in the $.fn namespace. Everything else is ‘private’ (held in the outermost closure).

    No public methods are needed nor provided.

    The mousewheel code is not a plugin as such. It is maybe better classified as an “addon”. The mousewheel adds an event type to jQuery, so elements can have mousewheel handlers attached/namespaced/triggered etc. in the same way as ‘click’, ‘mouseover’, ‘mouseout’ etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today, I have read that command's object in WPF can be serialized. And I'm
I decided to learn LISP today, and have been playing around with it for
Today I decided to get to understand cookies better. The easiest way seemed jQuery.
I have been stalking this great site for ages. Today I finally decided to
I decided to give Ruby a go today after hearing all of the great
Today I have finally decided to start climbing R's steep learning curve. I have
Today, I read some articles about Covariance, Contravariance (and Invariance) in Java. I read
I was working today and decided to start using JQUERY to make a toggle
I have been using iOS 5.1 for a while, today I have decided to
I learned about pystones today and so I decided to see what my various

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.