(function($){ $.fn.extend({ aaa:"a" ,uiInput: function(config){ return this.each(function() { var elemType = this.toString(); $this=$(this); if($(this).attr("type")=="text"){//If its an text input css ={ "margintop": $this.css("margin-top"), "marginright": $this.css("margin-right"), "marginbottom": $this.css("margin-bottom"), "marginleft": $this.css("margin-left") }; $this.css({margin:"0px","margin-top":"1px"}); $this.wrap("") .after("
"); $(this).parent().bind("mouseenter mouseleave",function(evt){ if(evt.type=="mouseenter"){ $(this).addClass("ui_input_hover"); }else{ $(this).removeClass("ui_input_hover"); } })//end of bind .css({"margin-top": css.margintop,"margin-right": css.marginright,"margin-bottom": css.marginbottom,"margin-left": css.marginleft}); $(".ui_input input").focus(function(){ $(this).parent().addClass("ui_input_hover") .unbind("mouseenter mouseleave"); }); //end of focus $(".ui_input input").blur(function(){ $(this).parent().removeClass("ui_input_hover"); $(this).parent().bind("mouseenter mouseleave",function(evt){ if(evt.type=="mouseenter"){ $(this).addClass("ui_input_hover"); }else{ $(this).removeClass("ui_input_hover"); } });//end of bind });//end of blur } });//end of return } ,bgLayer:function(config){ var config = config; var $this = $(this); return this.each(function() { css={//saving the css settings wich we wannamove to the inner div "paddingtop": $this.css("padding-top"), "paddingright": $this.css("padding-right"), "paddingbottom": $this.css("padding-bottom"), "paddingleft": $this.css("padding-left"), "height": $this.css("height"), "id": $this.attr("id") }; css.outerheight = parseInt($this.css("height").replace("px","")); css.outerheight +=parseInt($this.css("padding-top").replace("px","")); css.outerheight +=parseInt($this.css("padding-bottom").replace("px","")); $this.css({padding:"0px",height:css.outerheight});//resetting the settings wich we wanna move to the inner div //logg(config.length); inner_html = $this.html();//saving the content of the outer div $this.html("");//clearing it for(var i in config){ $this.append("
"); $this = $this.children();//referring $this to the most inner new div } $this.append(inner_html).css({ "padding-top":css.paddingtop, "padding-right":css.paddingright, "padding-bottom":css.paddingbottom, "padding-left":css.paddingleft, "height":css.height, "width": "auto" }).attr({"id":css.id+"_inner"}); });//end of return }//end of bgLayer });//end of extend })(jQuery);