Created
July 15, 2014 03:46
-
-
Save bhnddowinf/dbb5016cb7df84a05351 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
第一次用 | |
'''Java Script | |
asfasfas | |
'''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CSS
div {
width:50px;
height:50px;
background-color:#FFCC99;
border:1px solid black;
position:relative;
float:left;
}
Body HTML
Script
(function($){
$.fn.haha = function(settings){
var defaultSettings = {
bind : 'mouseover',
callback : function(){
$(this).animate({
opacity: 0.25,
left: '+=50',
height: 'toggle'
}, 3000,function(){
$("span").html('').append($(this).html() + '完成!').show().fadeOut(1000);
});
}
};
var _settings = $.extend(defaultSettings,settings);
return this.each(function() {
$(this).bind(_settings.bind, _settings.callback);
});
}
})(jQuery);
$(document).ready(function(){
$("div").haha();
});