CSS box-shadow in jQuery .css()

旧巷老猫 提交于 2019-12-05 04:08:27

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');

This:

$(this).css('box-shadow', '10px', '10px', '5px', '#888');

is an incorrect syntax. You need to have one value for the CSS property:

$(this).css('box-shadow', '10px 10px 5px #888');

Needs to be:

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

It should be:

$(this).css('-webkit-box-shadow', '10px 10px 5px #888');
$(this).css('-moz-box-shadow', '10px 10px 5px #888');
$(this).css('box-shadow', '10px 10px 5px #888');

For Safari, Google Chrome and Opera use

$(this).css('-webkit-box-shadow', '10px 10px 5px #888');

For Mozilla Firefox use

$(this).css('-moz-box-shadow', '10px 10px 5px #888');

For other web browsers use

$(this).css('box-shadow', '10px 10px 5px #888');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!