test page:
http://kitchenshop.ebeacon.net/catalog/
thanks,
luke

On Dec 4, 2008, at 6:29 PM, Michael Geary wrote:


It doesn't seem to work for me in Firefox either.

For some reason, $('.promotion_content').length evaluates to 0.

Oh! I get it. I'm missing the HTML code!

Sorry, just kidding around with you. :-)

But seriously, it's pretty hard to guess what might be wrong without a test
page to look at.

The one thing I can suggest from looking at the JS code alone is that
there's a big chunk of duplicate code that could be removed. That's unlikely to be related to the IE problem, though. So put up a test page and someone
can probably give you some ideas.

-Mike

From: luke adamis

Why isn't tis working in IE?

$(document).ready(function(){   

        //tabber

        var e = $('.promotion_content').length;
                
        var n = Math.floor(Math.random()*e);
        
        $('#promotion_holder > .promotion_content').hide();
                
        $('#promotion_holder > .promotion_content:eq('+n+')').show();
        $('#promotion_holder > #promotion_navigation > ul > li
a:eq('+n
+')').addClass('selected');
                
        $('#promotion_holder > #promotion_navigation > #next >
a').click (function () {
                if (n == e-1) { n = 0; } else { n = n+1; }
                $('#promotion_holder > .promotion_content').hide();
                $('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
                $('#promotion_holder >
.promotion_content:eq('+n+')').fadeIn('slow');
                $('#promotion_holder > #promotion_navigation >
ul > li > a:eq('+n
+')').addClass('selected');
                return false;
        });
        
        $('#promotion_holder > #promotion_navigation >
#previous > a').click (function () {
                if (n == 0) { n = e-1; } else { n = n-1; }
                $('#promotion_holder > .promotion_content').hide();
                $('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
                $('#promotion_holder >
.promotion_content:eq('+n+')').fadeIn('slow');
                $('#promotion_holder > #promotion_navigation >
ul > li > a:eq('+n
+')').addClass('selected');
                return false;
        });
        
        var tab_content = $('#promotion_holder > .promotion_content');
                
        $('#promotion_holder > #promotion_navigation > ul > li
a').click (function () {
                tab_content.hide().filter(this.hash).fadeIn('slow');
                                
                $('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
                $(this).addClass('selected');
                n = $(this).attr('name') - 1;
                
                return false;
                
        }).filter(':first').hover();

});

--------

both the random selection and the clicking on the next
previous buttons are messed up in IE6, IE7. if I set var e =
$ ('.promotion_content').length; to a fixed number, the
script works.
but I need to count the elements somehow first.

thanks,
luke





Reply via email to