0

これを使用して関数を作成する必要があります。そのクラスを追加するにはonMouseDown、他のクラスをonChange、最後のクラスをonBlurにします。「.animate」があればもっと素敵ですが、なくてもOKです。

onMouseDown="this.className='styleDropDownClick';
onChange="this.className='styleDropDown'";
onBlur="this.className='styleDropDown'; 

誰でも私を助けることができれば、ありがとう。

4

2 に答える 2

0

修理済み!私の問題は、選択の子が自動幅または特定の幅で拡大されていないことでした。

 $("select").click(function () {
    $(this).children().addClass("cooling");
    });

これは例です。IEでのみ機能します

http://jsfiddle.net/DCjYA/132/

于 2012-01-20T08:06:21.817 に答える
0

次の機能を試してください。

    function styleDropDownClick() {

        var textForm = document.forms["textForm"];
        textForm.fname.setAttribute("class", "styleDropDownClick");
    }
    function styleDropDown() {
        var textForm = document.forms["textForm"];
        textForm.fname.setAttribute("class", "styleDropDown");
    }

これは、次の HTML で機能します。

   <form id="textForm">
       <input type="text" class="styleDropDown" name="fname"
           onBlur="styleDropDown()" onChange="styleDropDown()" onMouseDown="styleDropDownClick()" value="test"/>
       <input type="text" class="styleDropDown" name="fname2" value="test2"/>
   </form>
于 2012-01-19T14:13:29.593 に答える