need help speeding up tag cloud filter for IE

Posted by rod on Stack Overflow See other posts from Stack Overflow or by rod
Published on 2010-05-05T23:43:02Z Indexed on 2010/05/05 23:48 UTC
Read the original article Hit count: 116

Filed under:
|

Hi All,

Any ideas on how to speed this up in IE (performs decent in Firefox, but almost unusable in IE). Basically, it's a tag cloud with a filter text box to filter the cloud.

<html>

<head>

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){


        $('#tagFilter').keyup(function(e) { 
            if (e.keyCode==8)
            {   
                $('#cloudDiv > span').show();
            }

            $('#cloudDiv > span').not('span:contains(' + $(this).val() + ')').hide(); 
        });

    });
</script>

</head>


<body>
<input type="text" id="tagFilter" />
<div id="cloudDiv" style="height: 200px; width: 400px; overflow: auto;">
<script type="text/javascript">

for (i=0;i<=1300;i++)
{
    document.write('<span><a href="#">Test ' + i + '</a>&nbsp;</span>');
}
</script>
</div>

</body>
</html>

thanks, rodchar

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript