Here is my ajax code, i have 81 products per page...
When i click add to cart button a div appears on the center of the page but when i add product to last or bottom in page, div always appears on the center of page and i need to scroll up the page to see it.
I want the result where i am on page, like if i am bottom of the page, I want the div to appear on bottom .
<script type="text/javascript" >
$(function() {
$('a.addbtn').click(function(e){
e.preventDefault();
var quantity = $(this).attr("qty");
var prod_id = $(this).attr("prid");
var dataString = '&quantity=' + quantity + '&prod_id=' + prod_id;
if(quantity=='' || prod_id==''){
alert('some thing went wrong');
}
else{
$.ajax({
type: "GET",
url: "ajax_checkout.php",
data: dataString,
cache: false,
success: function(html){
$('.addcart').remove('');
$("#viewr").append(html);
}
});
}
return false;
});
});
</script>