JS插件冲突

时间:2013-07-17 17:32:49

标签: javascript google-maps conflict jquery

如何在同一个文件中将这两个JS插件放在一起,而不会与其他人发生冲突?问题是,当我添加谷歌地图插件时,我的手风琴停止工作。有任何想法吗? 请在此处找到完整的代码:http://jsfiddle.net/bBdSH/谢谢!

/*----------------------------------------------- 
                A C C O R D I O N S
    ------------------------------------------------*/  
    $(document).ready(function() {
        var cur_stus;

        //close all on default
        $('.accordion .accordion-content').hide();
        $('.accordion .accordion-title').attr('stus', '');

        $('.accordion .accordion-title').click(function(){
            cur_stus = $(this).attr('stus');
            if(cur_stus != "active")
            {
                //reset everthing - content and attribute
                $('.accordion .accordion-content').slideUp();
                $('.accordion .accordion-title').attr('stus', '').removeClass('active');

                //then open the clicked data
                $(this).next().slideDown();
                $(this).attr('stus', 'active').addClass('active');
            }
            //Remove else part if do not want to close the current opened data
            else
            {
                $(this).next().slideUp();
                $(this).attr('stus', '').removeClass('active');
            }
            return false;
        });
    });

0 个答案:

没有答案