javascript - Animate CSS on selection of <option> -
i attempting trigger change of css objects further down in code when 1 of option tags selected. did not include them here not pertinent issue @ hand jquery. @ loss @ point. here have far...is possible?
<script> $(document).ready(function(){ $("#feed-filter option:selected").change(function () { $("#ca, #ga, #gd").animate({height: '0px'}); }) }) </script> <div class="feed-filter"> <select id="feed-filter" name="feed-filter"> <option id="option-all" value="all" selected>all</option> <option id="option-ca" value="a">a</option> <option id="option-dad" value="b">b</option> <option id="option-ga" value="c">c</option> <option id="option-gd" value="d">d</option> </select> </div>
firstly aren't triggering css animation, jquery animation. secondly, id's animating don't exist in html, , thirdly, selector/listener invalid, need listen $('select').change();
if need access value of selected option can doing this
$('select').change(function() { var val = $(this).val(); });