Apagar Registos Do MySQL Com jQuery

Este tutorial vai ajudá-lo a criar um efeito simples de animação para a remoção de registos da base de dados MySQL usando jQuery. O registo é movido para a esquerda a com AJAX é apagado da base de dados. Este código não está integrado com PHP. Terá que efectuar essa integração.

Veja a DEMO deste tutorial > Apagar Registos Do MySQL Com jQuery

Código JQuery


$(document).ready(function() {

$('.remove').livequery('click', function() {

$(this).parent().stop().animate({

left : '-800px',

},250,function(){

$(this).remove();
});

});

});

Código HTML

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Código CSS

html, body{
margin:0;
padding:0;
border:0;
outline:0;
}

#wrap
{
width:600px; height:900px; left:20px; top:20px; position:relative; bottom:0px;
}

#left_bar
{
top:120px;
left:600px;
height:350px;
width:250px;
position:fixed;
padding:10px;
}

.remove { cursor:pointer;float:right}

.label { float:left;width:350px; margin-left:10px;}

.shopp
{
border:solid #ccc 1px;
padding:8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px; font-size:12px;
background:url(remove.png) center right no-repeat 5px;
border-radius: 8px;
font-family:"LubalGraphBdBTBold",Tahoma;
margin-bottom:3px;
text-align:justify;
width:500px;
height:100px;
position:relative;
}

Download do código usado neste tutorial > Apagar Registos Do MySQL Com jQuery

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *


Como Criar Um Site, Blog - WebMaster.pt