dongshike7171
dongshike7171
2014-12-14 17:39
浏览 44
已采纳

Laravel - 重定向到页面并滚动到页面底部

Im using Laravel framework and in my controller I have

return Redirect::route('home'); 

which is redirecting to homepage. But I would like to accomplish the page to be scrolled down to see footer when redirecting. Something like href="home#footer" Is there a way for that?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dsiftnc99059
    dsiftnc99059 2014-12-14 17:43
    已采纳

    You can generate the URL for the route then append the hash and redirect to that url

    $url = URL::route('home') . '#footer';
    return Redirect::to($url);
    
    点赞 评论

相关推荐