Home > Web Front-end > JS Tutorial > Select mark beautification--JS plug-in, post-loading_form effects

Select mark beautification--JS plug-in, post-loading_form effects

WBOY
Release: 2016-05-16 17:38:38
Original
956 people have browsed it
The appearance of the

.
Advantages: Still using 标记,我们用一个class名称 "beautify" 来确定,没有这个样式的) 设置一个别名,在下面的匿名函数中将会被用到
            var select = this;

            //创建一个 ,  .dummy 将用于我们对此类 进行专门样式定义
            //同时将 插入 dom, 紧跟原 ")
                .attr("disabled", this.disabled)
                .css("width", parseInt(this.style.width) + "px")
                .css("display", this.style.display)
                .insertAfter(this)
                .val(this.options[this.selectedIndex].text);

            //将 被点击时
            input.click(function () {
                //调出前面创建的

,并清空内容
                //将 一致
                $(select).hasClass("extend")
                    ? div.css("width", "")
                    : div.css("width", $(this).innerWidth());

                //将

里面,一个