Hi all --

This is my first foray into the jQuery library!  I'm working on an Accordion
-- and I've got everything running smoothly in Firefox, but for the life of
me I cannot get this example to function using IE:

http://www.learningjquery.com/2007/03/accordion-madness

It functions just fine on their site in IE7, but when I imported the data
(perhaps I missed something?  I did strip out most of what I thought wasn't
being used) to my test environment, IE fails to perform the actions.  No
error messages or anything -- just no actions.  Here's the code I am using:

<html>
        <head>
                <script language="JavaScript"
src="/includes/jQuery/jquery-1.2.1.js" type="text/javascript"></script>
                <script type="application/javascript" language="javascript">
                        $(document).ready(
                                function()
                                {
                                        $('div.demo-show> div').hide();
                                        $('div.demo-show> h3').click(
                                                function()
                                                {
                                                        var $nextDiv =
$(this).next();
                                                        var $visibleSiblings
= $nextDiv.siblings('div:visible');
                                                        if
($visibleSiblings.length )
                                                        {
        
$visibleSiblings.slideUp('fast', function() {$nextDiv.slideToggle('fast');
});
                                                        }
                                                        else
                                                        {
        
$nextDiv.slideToggle('fast');
                                                        }
                                                }
                                        );
                                }
                        );
                </script>
                
                <style>
                        /* -----------------------------------
                           =more show, more hide
                        -------------------------------------- */
                        .demo-show {
                                width: 350px;
                                margin: 1em .5em;
                        }
                        
                        .demo-show h3 {
                                margin: 0;
                                padding: 5px;
                                width: 338px;
                                background: #bfcd93;
                                border-top: 1px solid #386785;
                                border-bottom: 1px solid #386785;
                                cursor: pointer;
                        }
                        
                        .demo-show div {
                                padding: 1em .25em .5em;
                        }
                        .demo-show p {
                                margin-top: 0;
                        }
                </style>
        </head>
        
        <body>
                <div class="demo-show">
                        <h3>Title 1</h3>
                        <div>Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.</div>
                        <h3>Title 2</h3>
                        <div>Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.</div>
                        <h3>Title 3</h3>
                        <div>Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum
dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</div>
                </div>
        </body>
</html>

Thanks in advance for any insights!

Jonathon



Reply via email to