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
$(document).ready(function(){ | |
function rem(e){ | |
alert("asdfasdf"); | |
}; | |
$("#remove").click(rem); | |
}); |
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
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { | |
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) { | |
options = options || {}; | |
var hasOptions = !$.isEmptyObject( options ), | |
effectName = options.effect || defaultEffect; | |
options.complete = callback; | |
if (options.delay) { | |
element.delay( options.delay ); | |
} | |
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { |
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
// Get a promise resolved when the currently queued functions complete | |
promise: function( type ) { | |
type = type || "fx"; | |
var defer = jQuery.Deferred(), | |
elements = this, | |
count = elements.length; | |
function resolve( next ) { | |
if ( !( --count ) ) { | |
defer.resolveWith( elements, [ elements ] ); |
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
test( "animate properties missing px w/ opacity as last (#9074)", 2, function() { | |
expect( 6 ); | |
stop(); | |
var div = jQuery( "<div style='position: absolute; margin-left: 0; left: 0px;'></div>" ) | |
.appendTo( "#qunit-fixture" ); | |
function cssInt( prop ) { | |
return parseInt( div.css( prop ), 10 ); | |
} | |
equal( cssInt( "marginLeft" ), 0, "Margin left is 0" ); | |
equal( cssInt( "left" ), 0, "Left is 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
function present( value, array, message ) { | |
QUnit.push( jQuery.inArray( value, array ) !== -1 , value, array, message ); | |
} | |
function notPresent( value, array, message ) { | |
QUnit.push( jQuery.inArray( value, array ) === -1 , value, array, message ); | |
} |
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
// helper function | |
function animate( props, opts ) { | |
var el = this, | |
anim = $.Deferred(), | |
propTimers = $.map( props, function( property, value ) { | |
// $.Timer is a deferred(progress?? jQuery.Callbacks if they make it into 1.7) | |
// object that is inserted into the jQuery.timers array that also | |
// picks up some of the properties/calcs from jQuery.fx -- "step" function | |
// animation data, etc... | |
var prop = $.Timer( el, property, duration ); |
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
#spinner { | |
... | |
-webkit-mask-image: url(../img/spinner.png); | |
background-color: #000; | |
-webkit-animation-name: spinnerRotate; | |
-webkit-animation-duration: 2s; | |
-webkit-animation-iteration-count: infinite; | |
-webkit-animation-timing-function: linear; | |
} | |
@-webkit-keyframes spinnerRotate { |
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
@-webkit-keyframes pulse { | |
0% { | |
background-color: red; | |
opacity: 1.0; | |
-webkit-transform: scale(1.0) rotate(0deg); | |
} | |
33% { | |
background-color: blue; | |
opacity: 0.75; | |
-webkit-transform: scale(1.1) rotate(-5deg); |
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
// $.fn.newContent behaves kinda like .live(), it will act on elements that match the | |
// selector now, or in the future... It automatically runs on any elements immediately | |
// matched, and also runs once on document ready. You then call .newContent() on any | |
// freshly created content to trigger searching it | |
// It will call the given callback function in the context of a | |
// jQuery set that matches the selector... | |
$("li.test").newContent(function() { | |
this.css("color", "red"); |
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
/* | |
* jQuery.ajaxQueue - A queue for ajax requests | |
* | |
* (c) 2011 Corey Frang | |
* Dual licensed under the MIT and GPL licenses. | |
* | |
* Requires jQuery 1.5+ | |
*/ | |
(function(a){var b=a({});a.ajaxQueue=function(c){function g(b){d=a.ajax(c).done(e.resolve).fail(e.reject).then(b,b)}var d,e=a.Deferred(),f=e.promise();b.queue(g),f.abort=function(h){if(d)return d.abort(h);var i=b.queue(),j=a.inArray(g,i);j>-1&&i.splice(j,1),e.rejectWith(c.context||c,[f,h,""]);return f};return f}})(jQuery) |
OlderNewer