In my jQuery code (I know the if statement isn't jQuery), the CSS property "right" for the class "slider" does NOT equal 30, yet "container" is still fading out on mousedown.. What am I doing wrong?
I want it to be: if the class of slider has a "right" CSS property equal to 30 pixels, then fadeout the container.
$(document).ready(function() {
$(".slider").mousedown(function() {
if ($('.slider')
.css({'right':30})
) {
$('.container')
.fadeOut('slow');
}
});
});
以上就是How do I get this if-statement with jQuery .css to work?的详细内容,更多请关注web前端其它相关文章!