Reputation: 1166
$('.lb').click(function() {
$('#modal').hide();
var id = $(this).attr('id');
var dir = '/lightbox/' + id + '.php';
$('#lightbox').find('#modal').load(dir, function() {
$('#modal').show();
$('#lightbox').fadeIn(200);
});
});
I currently have a dynamic lightbox but everytime I scroll it to the bottom then load a different page, it stays scrolled into the bottom of #modal
I've tried
$('#modal').show();
$('#modal').scrollTop(0);
$('#lightbox').fadeIn(200);
but it doesnt work
any help would be great!
EDIT - forgot to mention that im using http://areaaperta.com/nicescroll/
Upvotes: 0
Views: 58
Reputation: 9978
This should work:
$('#lightbox').find('#modal').load(dir, function() {
$('#modal').show();
$('#modal').scrollTop(0);
// Do also
$('#modal').scrollLeft(0);
$('#lightbox').fadeIn(200);
});
Upvotes: 0