John
John

Reputation: 619

Lightbox scroll to the top

I am implementing the following code:JSFiddle

Everything with the lightbox works fine. However when I open the lightbox it shows the middle of the content and I have to manually scroll to the top. I have tried to implement Javascript code

    $('#light').each(function(){
    $(this).click(function(){ 
        $('html,body').animate({ scrollTop: 0 }, 'slow');
        return false; 
    });
});

However it seems it does not work. Can anyone help please?

Thanks

Upvotes: 0

Views: 603

Answers (2)

Idov Mamane
Idov Mamane

Reputation: 382

Replace href="javascript:void(0)" by href="#"

Upvotes: 1

Bhavin Solanki
Bhavin Solanki

Reputation: 4818

In your .white_content class update your top:0 to top:115px This may help you to put your lightbox without scroll to top

Upvotes: 0

Related Questions