I have a problem with JQuery and inset Box-Shadow.
First of all I have a input field.
<input id="name" name="name" type="text" />
That field has the following css styles:
#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;
}
Okay. Now the JQuery part:
What I want to do! If I hover over my input field i want an “outer” box-shadow. Like: boxShadow: “0px 0px 15px #750082”. But the inset box-shadow should be the same!!
$(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"});
});
});
The problem is that the “outer” box shadow will be displayed as an inset box-shadow.
But I want an “outer” box-shadow and a inset box-shadow!
So whats wrong with my solution? Has someone a better one?
Best regards
edit
I’m using JQuery 1.6.2, for the boxshadow I’m using http://www.bitstorm.org/jquery/shadow-animation/test.html Plugin!
here are two options to get the same desired result
example jsfiddle
1: Use a wrapper for the
<input>jQuery:
2: Use CSS3 transitions instead
CSS:
you may consider writing the author of the shadow plugin to notify him/her of this issue.