我知道是scss我们可以使用父选择器类:
<div class="parent is-active">
<div class="children"></div>
</div>
.parent {
width: 200px;
height: 200px;
}
.children {
height: 100px;
width: 100px;
.is-active & {
background: red;
}
}
Run Code Online (Sandbox Code Playgroud)
那么父scss选择器呢?
这有效:
$("#formbottom").slideUp(speed,'swing',function(){
openSubmitting();
});
Run Code Online (Sandbox Code Playgroud)
这不是:
$("#formbottom").slideUp(speed,'swing',
openSubmitting()
);
Run Code Online (Sandbox Code Playgroud)
当你有回调时,你是否总是必须有一个匿名功能?你不能只是把你要打电话的功能?
jQuery(document).ready(function(){
if (document.cookie.indexOf('visited=true') === -1) {
var expires = new Date();
expires.setDate(expires.getDate()+30);
document.cookie = "visited=true; path=/; expires="+expires.toUTCString();
jQuery.colorbox({open:true,href:"<?=home_url()?>/popup/?site_type=2",iframe:true, innerWidth:"700px", innerHeight:"410px"});
}
});
Run Code Online (Sandbox Code Playgroud)
当我关闭浏览器时,此 cookie 会过期,但我希望它持续 30 天,直到他们再次看到弹出窗口。
如何在点击该图像时交换图像的SRC属性?
<a href="#">
<img src="./layout/images/search.png" />
</a>
$('img[src="./layout/images/search.png"]').click(function () {
$(this).attr('src',"./layout/images/search_select.png")
});
Run Code Online (Sandbox Code Playgroud)