有谁知道为什么这在 ie 中不起作用?似乎在所有版本的 IE 上都被破坏了,不知道为什么。在除 IE 之外的所有浏览器中,它都会找到图像并删除隐藏类并添加显示类。
onClickMakeActive("acousticCompression");
onClickMakeActive("Chiropractor");
onClickMakeActive("healthCoaching");
onClickMakeActive("oneOnOne");
function onClickMakeActive(className){
$("li."+className+"").click(function(){
var defaultDescription = $(".defaultDescription");
if(!defaultDescription.hasClass("hide")){
defaultDescription.addClass("hide");
}
var myThis = $(this);
makeActive(myThis, className);
$(".DONTHIDE").show();
});
}
function makeActive(myThis, className){
myThis.siblings().removeClass("active");
myThis.addClass("active");
myThis.siblings().find(".pointer").removeClass("show").addClass("hide");
myThis.find(".pointer").removeClass("hide").addClass("show");
var itemsToToggle = "."+className+"Toggle";
$(itemsToToggle).siblings().not(".dontHide").removeClass("show").addClass("hide");
$(itemsToToggle).removeClass("hide").addClass("show");
}
这是HTML以防万一
<div class="clearfix typeWrapper">
<ul class="serviceType dontHide">
<li class="acousticCompression"><a class="acousticCompression servicesTypes">Acoustic Compression</a><span class="pointer hide"></span></li>
<li class="healthCoaching"><a class="healthCoaching servicesTypes">Health Coaching</a><span class="pointer hide"></span></li>
<li class="Chiropractor"><a class=" servicesTypes">Chiropractic Care</a><span class="pointer hide"></span></li>
<li class="oneOnOne"><a class="oneOnOne servicesTypes">Comprehensive Holistic Care</a><span class="pointer hide"></span></li>
</ul>
<p class="defaultDescription">carefully selected and extensively trained a team of providers, who are all available to serve you either through his direction or as your direct provider</p>
<img class="managedHolisticCareToggle serviceTypeImage hide" src="[@RelImageRoot]/PatientIntakeForm/managedHolisticCare.jpg" alt="managed Holistic Care" width="" height="" />
<img class="acousticCompressionToggle serviceTypeImage hide" src="[@RelImageRoot]/PatientIntakeForm/acousticCompression.jpg" alt="acoustic Compression" width="" height="" />
<img class="ChiropractorToggle serviceTypeImage hide" src="[@RelImageRoot]/PatientIntakeForm/Chiropractor.jpg" alt="Chiropractor" width="" height="" />
<img class="healthCoachingToggle serviceTypeImage hide" src="[@RelImageRoot]/PatientIntakeForm/healthCoaching.jpg" alt="health Coaching" width="" height="" />
<img class="oneOnOneToggle serviceTypeImage hide" src="[@RelImageRoot]/PatientIntakeForm/one-on-one.jpg" alt="one-on-one" width="" height="" />
</div>
我没有看到任何错误返回,所以我有点困惑。
链接到有问题的页面https://beta.teammotio.com/drdenboer/Patient_Intake