Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery在div返回正常状态时启用单击_Jquery - Fatal编程技术网

JQuery在div返回正常状态时启用单击

JQuery在div返回正常状态时启用单击,jquery,Jquery,当单击的div处于活动状态时,是否有方法禁用单击其他div 我正在使用JQuery.toggle()函数 JQuery对于左两个div: $(document).ready(function() { $('.move_box_left_up').toggle(function() { $(this).css({"z-index":"20"}); $(this).animate({"height": "529px", "width": "460px"}, "

当单击的div处于活动状态时,是否有方法禁用单击其他div

我正在使用JQuery.toggle()函数

JQuery对于左两个div:

$(document).ready(function() {
    $('.move_box_left_up').toggle(function() {
        $(this).css({"z-index":"20"});
        $(this).animate({"height": "529px", "width": "460px"}, "slow");
        $(this).find('img').animate({"width": "460px"}, "slow");
    },function() {
        $(this).find('img').animate({"width": "220px"}, "slow");
        $(this).animate({"height": "163px", "width": "220px"}, "slow");
        setTimeout( function(){$('.move_box_left_up').css({"z-index":"10"});},500);
    })
});
JQuery对于右两个div:

$(document).ready(function() {
    $('.move_box_right_up').toggle(function() {
        $(this).css({"z-index":"20"});
        $(this).animate({"height": "529px", "width": "460px", "left":"-=240px"},"slow");
        $(this).find('img').animate({"width": "460px"}, "slow");
    },function() {
        $(this).find('img').animate({"width": "220px"}, "slow");
        $(this).animate({"height": "163px", "width": "220px","left":"+=240px"}, "slow");
        setTimeout( function(){$('.move_box_right_up').css({"z-index":"10"});},500);
    })
});

.

也许有一个条件并设置一个类似焦点的属性是合适的:

if ($('div[selected=selected]').length < 1) {
    $(this).attr("selected", "true");
if($('div[selected=selected])。长度<1){
$(this.attr(“选定的”、“真实的”);
编辑:更新代码


也许有一个条件并设置一个类似焦点的属性是合适的:

if ($('div[selected=selected]').length < 1) {
    $(this).attr("selected", "true");
if($('div[selected=selected])。长度<1){
$(this.attr(“选定的”、“真实的”);
编辑:更新代码


在将动画和css添加到条件中后,它看起来正在工作。我明白你之前的意思…正确的div通常在单击组合后消失。在将动画和css添加到条件中后,它看起来正在工作。我明白你之前的意思…正确的div通常在单击组合后消失点击的组合。