我需要用这个创建一个函数:onMouseDown 来添加那个类,onChange 那个其他类和 onBlur 最后一个类。有“.animate”更精彩,但即使没有也可以。
onMouseDown="this.className='styleDropDownClick';
onChange="this.className='styleDropDown'";
onBlur="this.className='styleDropDown';
如果anyoane可以帮助我,谢谢。
我需要用这个创建一个函数:onMouseDown 来添加那个类,onChange 那个其他类和 onBlur 最后一个类。有“.animate”更精彩,但即使没有也可以。
onMouseDown="this.className='styleDropDownClick';
onChange="this.className='styleDropDown'";
onBlur="this.className='styleDropDown';
如果anyoane可以帮助我,谢谢。
尝试以下功能:
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>
固定的!我的问题是 select 的子节点没有以自动宽度或给定宽度扩展。
$("select").click(function () {
$(this).children().addClass("cooling");
});
这是一个示例,它仅适用于 IE