Skip to content

Instantly share code, notes, and snippets.

@seyDoggy
Last active December 15, 2015 13:58
Show Gist options
  • Save seyDoggy/5270812 to your computer and use it in GitHub Desktop.
Save seyDoggy/5270812 to your computer and use it in GitHub Desktop.
stacks starter script, no comments.
stack = {
postDom : $(function () {
var myStack = stacks.myStack;
var thisID = myStack.setId('%id%');
myStack.setOption = '%id=someOption%';
myStack.callTallest(thisID);
}),
preDom : (function() {
if (!stacks.myStack) {
stacks.myStack = {
setId : function (id) {
var getId = id;
return getId;
},
setOption : null,
setElement : function (id) {
var getElement = $('#' + id + ' .someElement');
return getElement;
},
callMyTallest : function(id) {
if (this.setOption == true) {
this.setElement(id).myTallest();
}
}
}
})()
}
if (!jQuery.myTallest) {
(function($){
$.fn.myTallest = function(){
var tallest = 0,
thisTallest = 0;
$(this).each(function(){
thisTallest = $(this).height();
if (thisTallest > tallest) tallest = thisTallest;
}).height(tallest);
return $(this);
};
})(jQuery);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment