views:

121

answers:

1

I'm trying to set zIndex to markers, mainly, i want to set all green markers on top.

The code below works GREAT in any other browser but IE!

I'm checking in the marker is green if it's containing 'st1' in the filename.

I'm using mootools so the code is a bit mootools specific, but any javascript help would be appreciated:

gmarkers.each(function(mrk,ind){
    try {
        if (mrk.qa.image.indexOf('st1')!=-1){
            if (Browser.Engine.trident){
                mrk.Ir[0].zIndex = ind + 1000
            } else {
                mrk.Ir[0].setStyle('z-index',ind + 1000)
            }
        } else {
            if (Browser.Engine.trident){
                mrk.Ir[0].zIndex = ind
            } else {
                mrk.Ir[0].setStyle('z-index',ind )
            }

        }
    } catch (err){}
})
+1  A: 

found it, it's mrk.Ir[0].style.zIndex, not mrk.Ir[0].zIndex

I think you should be able to do `mrk.Ir[0].style.zIndex` everywhere actually, no need for browser sniffing.
Anthony Mills
I wasnt sure, so better safe then sorry :)