Good evening.
I have a button that when clicked, calls the function below:
$('#sa-success').click(function () {
swal({
title: 'Good job!',
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat, tincidunt vitae ipsum et, pellentesque maximus enim. Mauris eleifend ex semper, lobortis purus sed, pharetra felis',
type: 'success',
buttonsStyling: false,
confirmButtonClass: 'btn btn-primary'
});
});
But I wanted this function to be executed if a certain condition occurred in my IF. Example:
if(teste == true){
$('#sa-success').click(function () {
swal({
title: 'Good job!',
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat, tincidunt vitae ipsum et, pellentesque maximus enim. Mauris eleifend ex semper, lobortis purus sed, pharetra felis',
type: 'success',
buttonsStyling: false,
confirmButtonClass: 'btn btn-primary'
});
});
}
Is it possible?