樊凡烦_ 2017-09-08 03:57 采纳率: 0%
浏览 1668

onclick点击第二次时失效delselected(id)

$(function(){
getWishOrder(1);
getselectableOrder(1);

$(".list_con ul li").live('mouseenter',function(){
    $(this).find(".mengceng").show();
    $(this).find(".list_pro_detail").show();
})
$(".list_con ul li").live('mouseleave',function(){
    $(this).find(".mengceng").hide();
    $(this).find(".list_pro_detail").hide();
})
//点击编辑
$(".bianji").click(function(){
    $(this).hide();
    $(this).attr('data-index',1);
    $(".wancheng,.quxiao").show();
    $(".list_con ul li .add_box").show();       
});

//点击取消
$(".quxiao").click(function(){
    $(this).hide();
    $(".wancheng").hide();
    $(".bianji").show();
    $(".bianji").attr('data-index',0);
    $(".list_con ul li .add_box").hide();
});

//点击完成 
$(".wancheng").click(function(){
    $(this).hide();
    $(".bianji").attr('data-index',0);
    $(".quxiao").hide();
    $(".bianji").show();
    $(".list_con ul li .add_box").hide();
    window.location.reload();
});

$(".list_con ul li").live('mouseenter',function(){
    if($(".bianji").attr('data-index')=='1'){
        $(this).find(".mengceng").hide();
        $(this).find(".list_pro_detail").hide();
        $(this).find(".add_yx_box").html('<img src="../images/add_bx2.png" />');
        $(this).find(".add_bx_box").html('<img src="../images/add_yx2.png" />');
    }
})
$(".list_con ul li").live('mouseleave',function(){
    if($(".bianji").attr('data-index')=='1'){
        $(this).find(".mengceng").hide();
        $(this).find(".list_pro_detail").hide();
        $(this).find(".add_yx_box").html('<img src="../images/add_bx1.png" />');
        $(this).find(".add_bx_box").html('<img src="../images/add_yx1.png" />');
    }
})

})

  • 写回答

4条回答 默认 最新

  • qq_36592414 2017-09-08 05:51
    关注

    代码太冗余了,大家都没办法看,所以没办法回答,挑出关键的地方,需要执行这个delselected(id)的html,以及事件贴出就好了,欢迎继续追问

    评论

报告相同问题?