0

有谁知道为什么这在 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

4

2 回答 2

0

我想到的第一件事就是改变

$(".DONTHIDE").show();

$(".dontHide").show();

这些不应该区分大小写,但是...

于 2013-08-30T21:02:44.023 回答
0

查看您的网站,看起来这不是您的代码无法正常工作的问题,而是图像大小的问题。您的 5 张图片在 IE 中具有 width="1" 和 height"1",我想还有一些其他代码在修改它。

<img width="1" height="1" class="managedHolisticCareToggle serviceTypeImage hide" alt="managed Holistic Care" src="/drdenboer/userfiles/image//PatientIntakeForm/managedHolisticCare.jpg">

<img width="1" height="1" class="oneOnOneToggle serviceTypeImage show" alt="one-on-one" src="/drdenboer/userfiles/image//PatientIntakeForm/one-on-one.jpg">
于 2013-08-30T20:56:13.897 回答