[英]Lightbox scroll to the top
I am implementing the following code: JSFiddle 我正在实现以下代码: 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
我试图实现Javascript代码
$('#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 谢谢
用href =“#”替换href =“ javascript:void(0)”
在您的.white_content
类中,将top:0
更新为top:115px
这可能有助于您放置灯箱而不滚动到顶部
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.