javascript - Fancybox popup always scrolls on top -
i have implemented fancybox plugin in website, noticed issue:
every time click image, opens image correctly, scrolls on top of website, , does'nt let me scroll down when popup opened. can see issue in website here.
i tried using option "scrolloutside", doesn't work.
thank help!
before going solution, notice scrolling not fancybox
issue itself. can test through browser console in other pages:
$.fancybox("test");
in webpage, have several <div>
scrollable pages. maybe can scroll right page. writ scroll solution.
first need save page when click it.
var thispage = "homepage"; $(".page").click(function(){ thispage = $(this).attr("id"); });
now can scroll page whenever want. instance onclosed
:
$("a.inline").fancybox({ // ... other configurations ... 'onclosed' : function() { $("html,body").scrolltop($("#"+thispage).offset().top); } });
let me know if didn't work.
Comments
Post a Comment