Redirect to a div on a different page with smooth scrolling?

后端 未结 8 1186
悲哀的现实
悲哀的现实 2021-01-01 15:33

Question Background:

I have a 2 page website. Both pages use the same masterlayout.cshtml page which features a Navbar. Within the

8条回答
  •  醉酒成梦
    2021-01-01 16:40

    I guess you may use $.cookie every time you scroll on the first page.

    For Example :

    $(document).ready(function()
    {
        $('.scroll-link').on("click",function()
        {
           $.cookie('page',$(this).attr('data-id')); 
        });
        if($.cookie('page') != null || $.cookie('page') != "")
        {
            scrollToID($.cookie('page'), 1000);
        }
    })
    

提交回复
热议问题