$('#before-load').find('i').fadeOut().end().delay(400).fadeOut('slow');
и он по прежнему бесконечно крутится var num = 1;
$('.b1').on('click', function (e) {
num = parseInt($(this).data('num'));
})
$('.modal').on('shown.bs.modal', function () {
$(function(){
$('#before-load').find('i').fadeOut().end().delay(400).fadeOut('slow');
})
$('.slider__prod').slick({
initialSlide: num-1,
arrows: true,
centerPadding: 0,
accessibility: false,
prevArrow: '<button class="slick-prev slick-arrow" aria-label="Prev" type="button" style=""><i class="fa fa-chevron-left" aria-hidden="true"></i></button>',
nextArrow: '<button class="slick-next slick-arrow" aria-label="Next" type="button" style=""><i class="fa fa-chevron-right" aria-hidden="true"></i></button>',
responsive: [
{
breakpoint: 770,
settings: {
arrows: false,
centerMode: true,
}
}
]
}).on('setPosition', function(event, slick) {
slick.$slider.css({
opacity: 1,
visibility: 'visible'
});
});
});
$('.modal').on('hidden.bs.modal', function (e) {
$('.slider__prod').slick('unslick');
})
<form action="" method="post" class="ajax_form af_example">
<div class="form-group">
<label class="control-label" for="af_name">[[%af_label_name]]</label>
<div class="controls">
<input type="text" id="af_name" name="name" value="[[+fi.name]]" placeholder="" class="form-control"/>
<span class="error_name">[[+fi.error.name]]</span>
</div>
</div>
<div class="form-group">
<label class="control-label" for="af_email">[[%af_label_email]]</label>
<div class="controls">
<input type="email" id="af_email" name="email" value="[[+fi.email]]" placeholder="" class="form-control"/>
<span class="error_email">[[+fi.error.email]]</span>
</div>
</div>
<div class="form-group">
<label class="control-label" for="af_message">[[%af_label_message]]</label>
<div class="controls">
<textarea id="af_message" name="message" class="form-control" rows="5">[[+fi.message]]</textarea>
<span class="error_message">[[+fi.error.message]]</span>
</div>
</div>
<div class="form-group">
<div class="controls">
<button type="reset" class="btn btn-default">[[%af_reset]]</button>
<button type="submit" class="btn btn-primary">[[%af_submit]]</button>
</div>
</div>
[[+fi.success:is=`1`:then=`
<div class="alert alert-success">[[+fi.successMessage]]</div>
`]]
[[+fi.validation_error:is=`1`:then=`
<div class="alert alert-danger">[[+fi.validation_error_message]]</div>
`]]
</form>
<form action="" method="post" class="ajax_form af_example">
<div class="form-group">
<input type="name" class="form-control" id="af_name" aria-describedby="emailHelp" placeholder="Введите имя" name="name" value="[[+fi.name]]" required>
<span class="error_name">[[+fi.error.name]]</span>
</div>
<div class="form-group">
<input type="tel" class="form-control" id="af_phone" placeholder="Введите телефон" name="phone" value="[[+fi.phone]]" required>
<span class="error_phone">[[+fi.error.phone]]</span>
</div>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1" value="[[+fi.sogl]]" name="sogl" required>
<label class="form-check-label" for="exampleCheck1">Даю согласие на обработку персональных данных</label>
</div><br>
<button type="submit" class="btn form__btn">[[%af_submit]]</button>
[[+fi.success:is=`1`:then=`
<div class="alert alert-success">[[+fi.successMessage]]</div>
`]]
[[+fi.validation_error:is=`1`:then=`
<div class="alert alert-danger">[[+fi.validation_error_message]]</div>
`]]
</form>