javascript - Can it be written like this?
高洛峰
高洛峰 2017-05-19 10:12:00
0
3
585

$("#team .title" || "#team .title1").css("opacity","1");
or
$("#team .title" && "# team .title1").css("opacity","1");
Can it be written like this?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(3)
伊谢尔伦

There is an expression inside, "#team .title" || "#team .title1" "#team .title" && "#team .title1"因为字符串恒为真,所以两个分别永远都是$("#team .title") $("#team .title1")

为情所困

You can’t write like this

曾经蜡笔没有小新

"#team .title" || "#team .title1" = true
"#team .title" && "#team .title1" = false

Bold guess, $(true) $("falss") is obviously meaningless. If you don't know, just write some tests. It's really lazy.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template