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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.