/**
* This plugin provide service to render a button
* so that it will look more appealing
*
* @type : jQuery Plugin
* @author : irfanudin ridho
* @email : irfan.ub@gmail.com
* @version : 2.0
* @date : February 25, 2011
*/
(function($){
$.fn.button = function(){
$(this).addClass('button');
$(this).mouseover(function(){
$(this).addClass('button-hover');
});
$(this).mouseout(function(){
$(this).removeClass('button-hover');
});
$(this).mousedown(function(){
$(this).addClass('button-down');
});
$(this).mouseup(function(){
$(this).removeClass('button-down');
});
$(this).mouseout(function(){
$(this).removeClass('button-down');
});
}
})(jQuery);
$.fn.button = function(){
$(this).addClass('button');
$(this).mouseover(function(){
$(this).addClass('button-hover');
});
$(this).mouseout(function(){
$(this).removeClass('button-hover');
});
$(this).mousedown(function(){
$(this).addClass('button-down');
});
$(this).mouseup(function(){
$(this).removeClass('button-down');
});
$(this).mouseout(function(){
$(this).removeClass('button-down');
});
}
})(jQuery);
The css file:
.button { background: #aaf; padding: 5 10px;
font: 14px sans-serif; font-weight: bold;
color: white; -moz-border-radius: 5px;
border: 1px solid #aaf; }
.button-hover { background: #88f; cursor: pointer; }
.button-down { background: #51f; }
.button-hover { background: #88f; cursor: pointer; }
.button-down { background: #51f; }
No comments:
Post a Comment