Кто-нибудь знает, почему это не сработает в 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
if(!defaultDescription.hasClass("hide")){
не нужно. - person Kevin B   schedule 31.08.2013