SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast gazman99's Avatar
    Join Date
    May 2007
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Extend/Overide Jquery Plugin methods

    Hi all,

    Can someone explain in plain terms what the best way to extend an existing plugin is. For example; ExamplePlugin has several methods one being buildData.
    How can I use this plugin and add my own functions to it or get it to do extra actions after existing methods.
    Would the following work;

    Code:
    ExamplePlugin.buildData = function(){
           this.super.buildData()
           //do extra stuff
    }
    Many thanks, G

  2. #2
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    How you extend a jQuery plugin depends a bit on its internal structure, and might not be possible depending on how it is put together.

    You could of course modify the plugin itself or write your functionality independent of the plugin (which might be an even better option).
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •