如何将这两个 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;
});
});