Jump to content

JQuery slideDown goes too far, then back up?


coupe-r

Recommended Posts

Hi All,

 

When there is are error messages, I have jQuery slide down a Div.  But, when there are multiple errors, it slides down very far but once the slide is over, the page jumps back up to the bottom of the DIV (where it should have stopped sliding in the first place)

 

HTML

<!-- ERROR MESSAGE -->
<div id="error" style="display:none;">
<table width="40%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td width="75%" align="center">
			<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="errorBox">
				<tr>
					<td width="18%" align="center" valign="middle">
						<strong><font color="black"><img src="../images/general/error_sheild.png" title="Error(s)" alt="Error(s)" width="40" height="40" /></font></strong>
					</td>
					<td>
<?php
foreach($val_error as $value) 
{
	echo '<table border="0" cellpadding="2" cellspacing="0">';
	echo '<tr>';
	echo '<td><img src="../images/general/caution.png" alt="Error" title="Error" width="10" height="10"> <strong>'.print_r($value, 1).'</strong></td>';
	echo '</tr>';
	echo '</table>';
}
?>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</div>
<!-- END ERROR MESSAGE -->

 

JQuery

<script type="text/javascript">
jQuery(document).ready(function(){
	jQuery('#error').removeClass().slideDown(2000);
});
</script>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.