views:

56

answers:

1

The code that contains the error is:

var Slide = new Class({
    initialize: function(triggers, panels) {
        this.triggers = $(triggers).getElements('a[rel=content1-1]');
        this.panels = $(panels).getElements('ul[class=rel-content1-1]');
        this.active = -1;
        this.toggle();
    }, ...
})

This is called from later in the same file:

function activateSliders() {
    var slide_1 = new Slide('aCol', 'content');
    var slide_2 = new SlideTwo('content', 'content2', 'content2-hider');
}
window.onload = activateSliders();

Why does Chrome -- and only Chrome -- calculate $(triggers) as NULL?

+2  A: 

In my experience, IE and FF tend to be sporadically generous with letting jQuery code work nicely without it being encapsulated within a $(document).ready( block. Try:

$(document).ready(function() {
    activateSliders();
});
karim79