jQuery-如何编写“如果不等于"(与==相反) [英] jQuery - how to write 'if not equal to' (opposite of ==)

查看:67
本文介绍了jQuery-如何编写“如果不等于"(与==相反)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要反转以下代码.如果宽度不是500px,如何使动画运行.

I need to reverse of the following code. How can I make the animation run if the width is NOT 500px.

$(".image-div").not(this).each(function() {
        if ($(this).css('width') == '500px') {
            $(this).animate({
                    width: '250px'
                }, 500, function() {
                // Animation complete.
            });
        }


    });

换句话说,这是相反的东西吗:==

In other words, what the opposite of this?: ==

谢谢

推荐答案

==比较运算符相反的是!=.

The opposite of the == compare operator is !=.

这篇关于jQuery-如何编写“如果不等于"(与==相反)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆