Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS box-shadow in jQuery .css()

Firefox 18 does not seem to recognize the -moz-box-shadow or the box-shadow CSS attribute.

If I use border-color, everything works fine.

$($this).hover(
    function () {
        //$(this).css('border-color', '#ff0');
        $(this).css('box-shadow', '10px', '10px', '5px', '#888');
        //$(this).css('-moz-box-shadow', '10px', '10px', '5px', '#888');
    }, function () {
        $(this).css('border-color', '');
        //$(this).css('border-width', '');
    }
);

What am I doing wrong?

like image 559
Chris Avatar asked Jan 12 '13 15:01

Chris


1 Answers

You need to make the arguments into one string literal. The value parameter of the css(property name, value) function is one argument.

 $(this).css('box-shadow', '10px 10px 5px #888');
like image 102
Kevin Bowersox Avatar answered Oct 20 '22 22:10

Kevin Bowersox