Javascript または html を使用して、サイトのクロス ブラウザー対応のテキスト カルーセルを作成するにはどうすればよいですか? 以下のコードは Firefox でしか動作しないが、IE では失敗するため、苦労しました。両方で動作させる方法はありますか?
<h4>Carousel-Text-Below </h4>
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'
type='text/javascript'></script>
<script type='text/javascript'>
$(document).ready(function(){
function setRandomWord(){
var phrases =new Array("1-Blah Text","2-Blah Text","3-Blah Text");
$("#test").text(phrases[Math.floor(Math.random()*phrases.length)]);
}
setInterval(setRandomWord,3000);
});
</script>
</head>
<body>
<p style="border:1px dashed gray; background-color:white; padding: 10px">
<span id='test'>Blah Text-Text-Text</p>
</span> Guaranteed Service or...Text---Text</strong></p>
</body>
</html>