什么是JS 中闭包的主要目的.它只用于公共和私人变量吗?还是有其他我错过的东西.我试图了解关闭,并且真的想知道使用它的主要优点是什么.
我有以下jquery声明
$(this).('span.section1').css('background','url("images/accordion_closed_left.png") no-repeat scroll 0 0 transparent');
Run Code Online (Sandbox Code Playgroud)
如何为css条件编写if else语句.我的意思是如果背景图像是accordion_closed_left.png那么<do this>或者<do this>.
准确地说<do this>是声明块.
谢谢你的时间.