jQuery slideToggle jump on close

Posted by spankmaster79 on Stack Overflow See other posts from Stack Overflow or by spankmaster79
Published on 2010-06-09T09:17:09Z Indexed on 2010/06/09 13:22 UTC
Read the original article Hit count: 211

Filed under:
|
|

Hi,

I'm trying to slideToggle a in a table with jQuery and it works in FF, OP, CHrome. Only IE (6,7,8) is giving me problems. It slides down perfectly down and up, but after the slide up animation is finished. The hidden pops up in full height and then closes.

So I guess it must be somwhere inbetween when it switches from a minimal height to "display:none" that it appears for a short second.

The code is built dynamically but I'll try to give an example:

<table>
<tr>
    <td>
        <script type="text/javascript">
            function toggleTr_{$dynamicID}() {
                $('#content_{$dynamicID}').slideToggle('slow');
                /* DO SOME OTHER STOFF LIKE COLOR CHANGES CSS CLASS CHANGES */
            }
        </script>
    </td>
</tr>
<tr id="list_{$dynamicID}" onclick="toggleTr_{$dynamicID}();" style="cursor:pointer;">
    <td> <!-- INFO HEADER --> </td>
</tr>
<tr>
    <td>
        <div id="content_{$dynamicID}" style="display:none;">
         <!-- INFO BODY HIDDEN --> 
        </div
    </td>
</tr>

Other problems here with slideToggle only descibed problems with padding, margin, or problems with the animation, but that all works.

Help is appreciated.

Thx, Spanky

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery