Created
July 21, 2009 03:47
-
-
Save scottharvey/151095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.fn.editable = function () { | |
var settings = { | |
// global setting values go here | |
} | |
return this.each(function () { | |
var $this = $(this); // Cache a jQuery version of this | |
var tag = $this.get(0).tagName; | |
// perform element initialisation depending on tag type | |
switch(tag) { | |
case 'DIV': initDiv(); break; | |
case 'IMG': initImage(); break; | |
} | |
// functions used by divs only | |
function initDiv () { | |
} | |
function divFunction () { | |
} | |
// functions used by images only | |
functions initImage() { | |
} | |
function imageFunction () { | |
} | |
// functions used by divs and images | |
function sharedFunction () { | |
} | |
}); | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment