Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormikecron
    • CommentTimeAug 6th 2007
     permalink
    Hey folks,

    I've been doing to some looking around online to see if anyone's already posted a solution to this, to no avail. So, can anyone suggest a method by which I can hide or disable a mootools accordion effect from IE5.5 and earlier? I was trying to think of some conditional comment trick that I could use, but I don't think that will work. If instead there's a way to "unload" a function from a page after it's been set up, maybe that would be the way to go. My code, for example:

    <script type="text/javascript" src="<mas:imageurl>/scripts/mootools.js"></script>
    <script type="text/javascript">
    window.onload = function() {
    new Accordion($$('div#benefit h3'), $$('div#benefit div'));
    }
    </script>


    In this accordion, the H3's in the "benefit" DIV are clickable, and they alternately expand the child DIVs.

    Any ideas?
    • CommentAuthordavist11
    • CommentTimeAug 6th 2007
     permalink
    Are you really that worried about IE 5.5?
    •  
      CommentAuthorjernigani
    • CommentTimeAug 6th 2007
     permalink
    <!--[if gt IE 5.5]>

    <![endif]-->

    You could put that around all your javascript, and only IE greater than IE 5.5

    Look up IE comment in google and you will find some good recourses for commenting out code for IE.
    • CommentAuthormikecron
    • CommentTimeAug 6th 2007 edited
     permalink
    davist11: Sadly, yes. I'm using the accordion effect in a portion of a design for an e-commerce site, and we need to ensure that we cover the maximum range of browsers.

    Instead of letting the Mootools Accordion just "break," I'd rather take the road of progressive enhancement, where the more capable browsers show better & better interface enhancements. Thus my reason for actually "hiding" the script (or function) from this older browser.

    jernigani: Correct me if I'm wrong, but conditional comments won't work here because they effectively comment out their contents for Firefox, Safari, etc. They're only readable by IE/Win.
    •  
      CommentAuthorjernigani
    • CommentTimeAug 6th 2007
     permalink
    well, that's true, that it will comment it out completely. But that is a solution. :D Not really a perfect one, but you could put two versions of the javascript. One for IE 5.5, and one for everything else. Since that's what you are trying to do anyways. I'm not sure how much of the mootools you are trying to use, but this way might work.

    Have you tried the mootools forum? They could probably help you alot better than we could.
    • CommentAuthordavist11
    • CommentTimeAug 6th 2007
     permalink
    You would probably have to do some javascript browser detection to see if its IE 5.5 before calling the function. I'm not sure if mootools has browser detection functions built in or not.
    •  
      CommentAuthorjernigani
    • CommentTimeAug 6th 2007
     permalink
    oh yeah!!

    I feel stupid for not remembering this.

    mootools has this built in

    if(window.ie5){
    code for ie5
    }

    or you could use

    if(!window.ie5){
    code for everything that's not ie5
    }

    Just use whichever version of ie you need. There is more documentation about this on mootools.

    Sorry, i forgot about this.
    • CommentAuthormikecron
    • CommentTimeAug 8th 2007
     permalink
    davist11 & jernigani: thanks for that, it has put me on the right track. I'm currently hunting for the method in Accordion.js that IE55 doesn't like so I can test for browser support of that, instead of querying the browser and hoping for an honest answer. If you have any idea about that, I'd love to hear it, but otherwise thanks for the good info.
Add your comments
    Username Password
  • Format comments as (Help)