我有一个问题与JQuery和插入Box-Shadow.
首先,我有一个输入字段.
<input id="name" name="name" type="text" />
Run Code Online (Sandbox Code Playgroud)
该字段具有以下css样式:
#contact input[type="text"] {
background: rgba(55,55,55, 0.6);
height:2em;
border: 1px dashed #666;
width:200px;
box-shadow:inset 0px 0px 10px #222;
border-radius: 2px;
}
Run Code Online (Sandbox Code Playgroud)
好的.现在JQuery部分:
我想做的事!如果我将鼠标悬停在输入字段上,我想要一个"外部"框阴影.喜欢:boxShadow:"0px 0px 15px#750082".但插入的盒子阴影应该是一样的!!
$(document).ready(function(){
$("#message").hover(
function()
{$(this).stop().animate({boxShadow: "0px 0px 15px #750082"},800);
},
function()
{$(this).stop().animate({boxShadow: "inset 0px 0px 10px #222222"});
});
});
Run Code Online (Sandbox Code Playgroud)
问题是"外部"框阴影将显示为插入框阴影.但我想要一个"外部"盒子阴影和一个插入盒子阴影!
那么我的解决方案有什么问题吗?谁有人更好?
最好的祝福
编辑 我正在使用JQuery 1.6.2,我正在使用http://www.bitstorm.org/jquery/shadow-animation/test.html插件的boxshadow !