JQuery在div返回正常状态时启用单击
当单击的div处于活动状态时,是否有方法禁用单击其他div 我正在使用JQuery.toggle()函数 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"}, "
$(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通常在单击组合后消失点击的组合。