κ°λ¨ν μΌμ νλ €κ³ ν©λλ€. μ¬μ©μκ° νμΈ λ²νΌμ ν΄λ¦ν λκΉμ§ νμ μ λ«κ³ μΆμ§ μμ΅λλ€(μ΄ μ΅μ μ κ»μ§λ§ νμ μ΄ κ³μ λ«νλλ€). λ΄ μ½λλ λ€μκ³Ό κ°μ΅λλ€.
sweetAlert({
title: "Hello",
text: "<button type='button' class='btn btn-fb fb-share'>Share on Facebook</button>",
type: null,
confirmButtonText: "Close",
html: true,
closeOnConfirm: false, //It does close the popup when I click on close button
closeOnCancel: false,
allowOutsideClick: false
});
$(document).on( "click",".fb-share", function(e){
//here sweet alert closes when I press this button.
openFbPopup();
});
λ¬μ½€ν μλ¦Όμ΄ λ«νμ§ μλλ‘ νλ €λ©΄ μ΄λ»κ² ν©λκΉ?
μ λ μ΄κ²μ λ¬Έμ κ° μλ κ² κ°μ΅λλ€. allowOutsideClickμ falseλ‘ μ€μ ν κ²½μ°μλ μ¬μ ν λ«μ μ μμ΅λλ€.
@moazam1 νΉμ κ²½μ°μλ μ΅μ κ°μ²΄ λ€μμ μΆκ° 맀κ°λ³μλ‘ μ½λ°±μ μνν΄μΌ ν©λλ€.
sweetAlert({
title: "Hello",
text: "<button type='button' class='btn btn-fb fb-share'>Share on Facebook</button>",
type: null,
confirmButtonText: "Close",
html: true,
closeOnConfirm: false, //It does close the popup when I click on close button
closeOnCancel: false,
allowOutsideClick: false
}, function () {});
$(document).on( "click",".fb-share", function(e){
//here sweet alert closes when I press this button.
openFbPopup();
});
μ무 κ²λ ν νμκ° μμ§λ§ λ€μκ³Ό κ°μ κΈ°λ₯μ μ¬μ©ν©λλ€.
function (isConfirm) {
// ... Rest of code
}
μλμΌλ‘ μλ΅νκ³ λ€λ₯Έ μμ μ μνν μ μμ΅λλ€.
λ§μΉ νΈλ€λ¬κ° μλ κ²μ²λΌ, κ·Έλ μ§ μμΌλ©΄ μ΄λ»κ² κ²½κ³ λ₯Ό λ«μ κ²μ λκΉ?
μ΅μ»€ νκ·Έλ₯Ό μ¬μ©νλ κ²½μ° λμΌν νμ΄μ§λ‘ 리λλ μ νλ―λ‘ href=""λ₯Ό μ κ±°νλ©΄ λ©λλ€. κ·Έλμ κ²½κ³ κ° μ€μ€λ‘ λ«νμ΅λλ€.
λλ μ΄κ²μ΄ λ¦μλ€λ κ²μ μκ³ μμ§λ§ λ―Έλμ λκ΅°κ°λ₯Ό λμΈ μ μμ΅λλ€
@moazam1 μ΅μ μ΄ λ€μμΌλ‘ λ³κ²½λμμ΅λλ€.
swal({
closeOnClickOutside: false,
});
μ΄κ²μ μλνμ§ μμμ΅λλ€.
@moazam1 λλΆμ μ μκ² λμμ΄ λμμ΅λλ€.
@moazam1
$(λ¬Έμ).on( "ν΄λ¦",".fb-곡μ ", κΈ°λ₯(e){
μ¬κΈ°μ e.preventDefault()λ₯Ό μΆκ°ν΄μΌ ν©λλ€.
μ€νFbνμ
();
κ·Έκ²μ λλ₯Ό μν΄ μΌνμ΅λλ€.
});
κ°μ₯ μ μ©ν λκΈ
λλ μ΄κ²μ΄ λ¦μλ€λ κ²μ μκ³ μμ§λ§ λ―Έλμ λκ΅°κ°λ₯Ό λμΈ μ μμ΅λλ€
@moazam1 μ΅μ μ΄ λ€μμΌλ‘ λ³κ²½λμμ΅λλ€.
https://sweetalert.js.org/docs/#closeonclickoutside