SlideDown then call custom function

Posted by user275074 on Stack Overflow See other posts from Stack Overflow or by user275074
Published on 2010-03-18T12:05:15Z Indexed on 2010/03/18 12:21 UTC
Read the original article Hit count: 370

Filed under:
|

Hi,

Having difficulty understanding why my function is being called twice.

I'm trying to detect when a radio button is called (intRev_yes), check if a div is empty, slide down another div and then call a custome function which dynamically creates a date field.

if(this.id=="intRev_yes"){
 if($('div#mainField').is(':empty')){
  $('.intRevSections').slideDown('slow',function(){
   current=-1;
   addIrField();
  });
 }   
}

When I alert out at each stage, after getting to the end (i.e. addIrField()), the script seems to go back to the slideDown() section and recalls addIrField(). I can't understand why, there are no loops. current is used as an index for the date field.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about slidedown