Skip to content

Instantly share code, notes, and snippets.

@bhnddowinf
Created July 15, 2014 03:46
Show Gist options
  • Save bhnddowinf/dbb5016cb7df84a05351 to your computer and use it in GitHub Desktop.
Save bhnddowinf/dbb5016cb7df84a05351 to your computer and use it in GitHub Desktop.
測試
第一次用
'''Java Script
asfasfas
''''
@bhnddowinf
Copy link
Author

CSS

div {
width:50px;
height:50px;
background-color:#FFCC99;
border:1px solid black;
position:relative;
float:left;
}

Body HTML

1
2
3

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();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment