slideDown, slideUp not working in jQuery -
hi friends slidedown , slideup function not working code. appears hidden row without slidedown effect please guys can chekc code below or see fiddle here
html
<table> <tr> <td colspan="2"><p>logistics</p> <select name=" " > <option>one</option> <option>two</option> <option>three</option> <option>four</option> <option>others</option> </select> </td> </tr> <tr> <td width="80%" colspan="2"><textarea name=" 5" rows="2" id=" 5" onblur="if (this.value=='') this.value = this.defaultvalue" onfocus="if (this.value==this.defaultvalue) this.value = ''">others details</textarea> </td> </tr> </table>
script
$('tr').has('textarea').hide(); $('select').on('change',function(){ if($(this).val()=='others') { //$(this).next('tr td').has('textarea').slidedown(200); $(this).parent('td').parent('tr').next('tr').slidedown(200); //alert('other') } else { //$(this).next('tr td').has('textarea').slidedown(200); $(this).parent('td').parent('tr').next('tr').slideup(200); //alert('other') } })
check demo jsfiddle
jquery
$('tr').not(':first').children('td').wrapinner('<div>'); $('select').on('change',function(){ if($(this).val()=='others') { $('td > div').slidedown(2000, function() { $(this).parent().slidedown(2000); }); } else { $('td > div').slideup(1000, function() { $(this).parent().slideup(); }); } });
Comments
Post a Comment