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
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); | |
} | |
}).blur(function() { | |
var input = $(this); |
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
// SCSS mixin for html5 placeholder text. | |
// Based on Codesnippits article http://css-tricks.com/snippets/css/style-placeholder-text/ | |
// | |
// @include placeholder { | |
/* css properties */ | |
//} | |
@mixin placeholder { | |
&:-moz-placeholder { @content } | |
&::-webkit-input-placeholder { @content } |
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
// SCSS mixin for element embossing. | |
// A semi-transparent one-pixel lines placed above and below an element to give the illusion it’s embossed in its parent. | |
// | |
// @include box-emboss(0.8, 0.05); | |
@mixin box-emboss($opacity, $opacity2){ | |
box-shadow:white($opacity) 0 1px 0, inset black($opacity2) 0 1px 0; | |
} |
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
// SCSS mixin for letter embossing. | |
// A semi-transparent text shadow around letters to give the illusion of "letterpressing". | |
// | |
// @include letter-emboss(0.8); | |
@mixin letter-emboss($opacity){ | |
text-shadow:white($opacity) 0 1px 0; | |
} |
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
define(['jquery', 'filepicker'], function($, TweenMax) { | |
var FileUpload = (function() { | |
var Uploaded = {}; | |
// Upload modal | |
function upload( el, position ) { | |
Uploaded.location = $(el); |
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 AjaxForm($el) { | |
this.$form = $el; | |
this.form = $el[0]; // Internal state via properties | |
this.$form.on('submit', $.proxy(this.submit, this)); | |
}; | |
AjaxForm.prototype = { | |
submit: function(e) { // Named Functions | |
e.PreventDefault(); | |
var this = this; |
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 Datepicker($el) { | |
this.$el = $el; | |
} | |
Datepicker.prototype = { | |
hide: function() { | |
this.$el.datepicker('hide'); | |
}, | |
show: function() { | |
this.$el.datepicker('show'); |
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
var Duck = function(){ | |
this.quack = function(){alert('Quaaaaaack!');}; | |
this.feathers = function(){alert('The duck has white and gray feathers.');}; | |
return this; | |
}; | |
var Person = function(){ | |
this.quack = function(){alert('The person imitates a duck.');}; | |
this.feathers = function(){alert('The person takes a feather from the ground and shows it.');}; | |
this.name = function(){alert('John Smith');}; |
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
var FormInputMixin = { | |
getValue: function() { | |
return this.$el.val(); | |
}, | |
setValue: function(val) { | |
return this.$el.val(val); | |
} | |
} | |
var FormInputs = ['Textbox', 'Select', 'Checkbox']; |
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
http://tympanus.net/codrops/2010/01/05/some-useful-javascript-jquery-snippets/ | |
http://tympanus.net/codrops/2010/01/07/some-useful-javascript-jquery-snippets-part-2/ | |
http://tympanus.net/codrops/2010/01/08/some-useful-javascript-jquery-snippets-part-3/ | |
http://tympanus.net/codrops/2010/01/11/some-useful-javascript-jquery-snippets-part-4/ |
OlderNewer