I see one problem right away: You're getting a "guid is null or not an
object" error in your initialization code. Walking up the call stack, it
turns out that this comes from the .hover() call at the end of your
JavaScript code. The .hover() method takes two function arguments, and it's
not being called with these arguments.

Once you get past that error, I notice that clicking the Next button seems
to work OK, but it only highlights the selected item number on every other
click. This is happening because your $('#promotion_holder >
#promotion_navigation > ul > li a') selector (with the :eq(n) part removed)
is selecting 18 elements, not the 9 elements that you expect.

Looking at the page with the IE Developer Toolbar, it does indeed show that
each of your LI elements contains not only the expected A element, but a
second A element as well.

I didn't investigate why that is happening.

Do you have any debugging tools for IE? Here's what you need to do the
investigation I just did. First, do this Google search:

ie developer toolbar

and install the developer toolbar. This includes a page inspector similar to
the one in Firebug.

Then, use this Google search:

visual web developer express debug javascript

The first result should be a page on berniecode.com that explains how to set
up Microsoft's free Visual Web Developer 2008 Express Edition to debug
JavaScript in IE. There's one item the page omits: I found that you need to
make IE the default browser before starting debugging.

This is actually an outstanding JavaScript debugger, much better than the
one in Firebug or any other.

-Mike

> From: luke adamis
> 
> 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