Need help to fix a script with dynamic content -
i can't figure out why not working. i'm trying different div tags have different text content in cycle loop.
<script type="text/javascript"> var text1 = ['foo', 'bar', 'baz']; var i1 = 0, var text2 = ['hug', 'kiss001', 'bank22']; var i2 = 0, $(document).ready(function() { setinterval(function (){ $("#div1").fadeout(function () { $("#div1").text(text[i1++ % text1.length]).fadein(); }); }, 1000); setinterval(function (){ $("#div2").fadeout(function () { $("#div2").text(text[i2++ % text2.length]).fadein(); }); }, 1000); }); </script>
<div id="div1"><div> <div id="div2"><div>
seems bunch of syntax errors (text instead of text1/text2, no closing /div, etc. works fine here: http://jsbin.com/obaqi4/3
Comments
Post a Comment