Code breaks when updating jQuery due to changes in toggle

前端 未结 2 1997
醉话见心
醉话见心 2020-11-30 15:28

Background

I have recently taken over development on a project from a programmer that was using multiple jquery versions from 1.3x to 1.6x... Now that I have impl

2条回答
  •  感情败类
    2020-11-30 16:20

    The toggle you used is deprecated in jQuery 1.9 see jQuery 1.9 upgrade guide

    $('div.instruc').toggle(function() {
            $('div.instrucContent').slideUp('normal');  
            $(this).next().slideDown('normal');
        }
        ,function() { $('div.instrucContent').slideUp('normal');
        $("div.instrucContent").hide();
        });
    

    Or

    $('div.ddinstruc').toggle(function() {
            $('div.instrucContent').slideUp('normal');  
            $(this).next().slideDown('normal');
        }
        ,function() { $('div.instrucContent').slideUp('normal');
        $("div.instrucContent").hide();
    
    });
    

提交回复
热议问题