Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $.fn.creofocus = function(options) {
- this.each(function(){
- alert($(this).attr('id'));
- });
- this.on('focus', function(){
- var input = $(this),
- val = input.val();
- if (!val) {
- input.removeClass('empty').addClass('focused');
- } else {
- input.removeClass('filled').addClass('focused');
- }
- });
- this.on('blur', function(){
- var input = $(this),
- val = input.val();
- if (!val) {
- input.addClass('empty').removeClass('focused');
- } else {
- input.addClass('filled').removeClass('focused');
- }
- });
- return this;
- };
- }(jQuery));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement