In IE, apparently dynamically populating the contents of a tr element using .innerHTML isn't allowed. That's why when you try to randomize TR instead of DIV containers, it doesn't work in IE.
One workaround for this in IE seems to be to randomly move the rows around, using table.moveRow(). This method is IE only. With that said, replace the original randomizeContent() function with the below instead:
Code:
function randomizeContent(classname){
var contents=randomizeContent.collectElementbyClass(classname)
contents.text.sort(function() {return 0.5 - Math.random();})
var tableref=contents.ref[0].parentNode
for (var i=0; i<contents.ref.length; i++){
if (tableref.moveRow)
tableref.moveRow(0, Math.round(Math.random()*(tableref.rows.length-1)))
else
contents.ref[i].innerHTML=contents.text[i]
contents.ref[i].style.visibility="visible"
}
}
That should do it in getting the script to work on TR elements as well in IE.
Bookmarks