Shirin ogohlantirish muloqot oynasidagi "OK" tugmasini olib tashlang

JavaScript-ni yoqimli ogohlantirish kutubxonasidan foydalanaman:

https://limonte.github.io/sweetalert2/

https://github.com/limonte/sweetalert2

Ogohlantirish qutisidan OK tugmasini olib tashlashni xohlayman, ammo bu tugmani ko'rsatmaslik uchun hech qanday imkoniyat topmadim.

Ogohlantirishni bir soniyada o'chirish uchun taymer xususiyatidan foydalanaman taymer: 1000 . Shunday qilib, bu masala bo'yicha o'q tugmasidan foydalanishni o'ylamayman.

enter image description here

10
konfiguratsiyangizda showConfirmButton: false ni o'rnating. Hujjatlarga havola
qo'shib qo'ydi muallif haxxxton, manba

8 javoblar

Siz ushbu xususiyatlardan foydalanishingiz mumkin:

showCancelButton: false,//There won't be any cancel button
showConfirmButton: false//There won't be any confirm button

Shunga o'xshash

swal({
  title: 'Auto close alert!',
  text: 'I will close in 2 seconds.',
  timer: 2000,
  showCancelButton: false,
  showConfirmButton: false
}).then(
  function() {},
 //handling the promise rejection
  function (dismiss) {
    if (dismiss === 'timer') {
      //console.log('I was closed by the timer')
    }
  }
)
17
qo'shib qo'ydi
Mening ilovam bilan ishlagan: angular2 + sweetalert2, mening vaqtimni saqladi! :)
qo'shib qo'ydi muallif amey, manba

Update 4/6/2018

showCancelButton va showConfirmButton endi kerak emas. Buning o'rniga tugmachalarni o'rnatishingiz mumkin: har ikkala tugmani yoki tugmalarini ko'rsatish uchun haqiqiy: barcha tugmalarni yashirish uchun noto'g'ri. Sukut bo'yicha faqat tasdiqlash tugmasi ko'rsatiladi.

Shunday qilib, endi bajarish o'rniga

showCancelButton: noto'g'ri;

showConfirmButton: noto'g'ri;

Faqat qil

tugmalari: noto'g'ri;

Kontaktlar

8
qo'shib qo'ydi

Siz konfiguratsiyangizda showConfirmButton: false ni o'rnatishingiz kerak.

swal({
  title: 'Are you sure?',
  text: "You won't be able to revert this!",
  type: 'warning',
  showConfirmButton:false,
  confirmButtonText: 'Yes, delete it!'
})

Here's the fiddle

3
qo'shib qo'ydi
swal({

    title: "Success",
    text: "Permissions assigned Successfully",
    icon: "success",
    closeOnClickOutside: false,
})

closeOnClickOutside: noto'g'ri, dan foydalaning Bu men uchun ishlaydi.

2
qo'shib qo'ydi

This works for me: $(".confirm").attr('disabled', 'disabled');

Mening vazifam:

function DeleteConfirm(c){
  swal({   
            title: "Want to delete this item?",   
            text: "You will not be able to undo this action!",   
            type: "warning",   
            showCancelButton: true,   
            confirmButtonColor: "#DD6B55",   
            confirmButtonText: "Yes, delete it!",   
            closeOnConfirm: false 
        }, function(){ 
          $(".confirm").attr('disabled', 'disabled'); 

        });
}
1
qo'shib qo'ydi

Har qanday tugmachani qo'shishdan oldin barcha tugmalarni o'chiring va ularni qayta qo'shing (Alert nomi "A" bo'lsa) -

A.getButtonTypes().clear();
ButtonType OpenStorage=new ButtonType("Open Storage");
A.getButtonTypes().addAll(OpenStorage,ButtonType.CANCEL,ButtonType.NEXT);

Umid qilamanki yordam beradi!

0
qo'shib qo'ydi

showConfirmButton xususiyatini FALSE ga sozlang.

Hujjatlariga qarang

0
qo'shib qo'ydi

Quyida kod men uchun ishlaydi

I have only set buttons: false;

va yangilash

swal({
    title: 'Auto close alert!',
    text: 'I will close in 2 seconds.',
    timer: 2000,
    showCancelButton: false,
    showConfirmButton: false
});
0
qo'shib qo'ydi
Javascript UZB
Javascript UZB
99 ishtirokchilar

@js_uzb @vuejs_uz @react_uz @nodejs_uz @angular_uz @ngTashkent @yiiframework_uz @laravel_uz @linux_uzbek @python_uz @swift_uzb —————— @uzdevgroup @UzGeeksGroup ——— @UzDev_Jobs @jobs_uzb