I'm fairly new to jQuery and I'm having trouble with an animation that I'd like to do.
Say I have some drops downs to filter content that use this HTML:
<table class="calFilter">
<tr>
<th>
<label for="ddlDept">Show events hosted by:</label>
</th>
<th>
<label for="ddlEventType">Select event type:</label>
</th>
</tr>
<tr>
<td>
<select name="ddlDept" id="ddlDept" class="deptDropDown">
<option value="">All</option>
<option value="cfys">Community, Family, & Youth Services</option>
<option value="conser">Conservation Board</option>
<option value="emergm">Emergency Management</option>
<option value="health">Health Department</option>
</select>
</td>
<td>
<select name="ddlEventType" id="ddlEventType">
<option value="0">All</option>
</select>
</td>
<td>
<input type="submit" name="cmdGo" value="Go" id="cmdGo" />
</td>
</tr>
</table>
If you select a different department, the event types no longer make sense, so I'd like to hide the Event Type label and drop down when the Dept drop down changes. I got this to work using the change event callback for the drop down and the simple hide()
command.
But if I try to use animation, things go haywire. The controls don't slide the way I would expect, the animation occurs every time even if the controls are already hidden, etc.
I would like some sort of nice fade or slide, or some combination of those two. How would you do this?