[Tutorial] Exibir confirmação antes de excluir uma mensagem
Página 1 de 1 • Compartilhe
Autor: Shek Crowley
Funcionalidade: Todas as versões
Descrição: Com esse pequeno sistema será possível emitir um alerta ao clicar em "Excluir mensagem" para confirmar a exclusão.
Acesse:
Painel de Controle Módulos HTML & Javascript Gestão dos códigos Javascripts
E crie um novo javascript com investimento nos tópicos com esse código:
- Código:
jQuery(function () {
jQuery(".postfoot a[href*='mode=delete'][href*='p='][href*='tid=']").click(function (a) {
a.preventDefault();
var shek_delet = jQuery(this).closest(".post");
!0 == confirm("Deseja excluir essa mensagem?") && jQuery.post(this.href, {
confirm: 1
}, function (a) {
shek_delet.slideUp(function () {
shek_delet.remove();
jQuery(".main-content.topic .post").length || location.replace(jQuery(".nav[href^='/f']:last")[0].href)
})
})
});
});
- Código:
jQuery(function () {
jQuery(".post-options a[href*='mode=delete'][href*='p='][href*='tid=']").click(function (a) {
a.preventDefault();
var shek_delet = jQuery(this).closest(".post");
!0 == confirm("Deseja excluir essa mensagem?") && jQuery.post(this.href, {
confirm: 1
}, function (a) {
shek_delet.slideUp(function () {
shek_delet.remove();
jQuery("table.forumline .post").length || location.replace(jQuery(".nav[href^='/f']:last")[0].href)
})
})
});
});
- Código:
// Shek Forumeiros ->> facebook.com/shek.forumeiros
jQuery(function () {
jQuery(".post a[href*='mode=delete'][href*='p='][href*='tid=']").click(function (a) {
a.preventDefault();
var shek_delet = jQuery(this).closest(".post"); !0 == confirm("Deseja excluir essa mensagem?") && jQuery.post(this.href, {confirm: 1}, function (a) {shek_delet.slideUp(function () { shek_delet.remove();
// REDIRECIONANDO PARA O SUBFÓRUM CORRESPONDENTE AO TÓPICO
jQuery(".main-content.topic .post").length || location.replace(jQuery(".nav[href^='/f']:last")[0].href)
})})});});
- Código:
jQuery(function () {
jQuery(".post-footer a[href*='mode=delete'][href*='p='][href*='tid=']").click(function (a) {
a.preventDefault();
var shek_delet = jQuery(this).closest(".post");
!0 == confirm("Deseja excluir essa mensagem?") && jQuery.post(this.href, {
confirm: 1
}, function (a) {
shek_delet.slideUp(function () {
shek_delet.remove();
jQuery(".borderwrap .post").length || location.replace(jQuery(".nav[href^='/f']:last")[0].href)
})
})
});
});
- Resultado:
Cria uma conta ou logue para postar uma mensagem.
Você precisa ser um membro, para poder postar uma resposta.
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|