![](/img/trans.png)
[英]Is it possible after making an action or in my case creating an event in calender then the page automatically scrolls down using JavaScript?
[英]Automatically scroll down after submit action
如何從我的網頁底部的“聯系表格”發送電子郵件后自動向下滾動我的網站? 有關在表單下方成功發送或出現錯誤的信息以及點擊“提交”按鈕頁面后的信息令人耳目一新,用戶只能看到網站的頂部,而不是底部......
<form id="form" action="{your_action}#form">
....
</form>
發送到頁面上的錨標簽,發送sumbit
http://foo.com#youranchor
此開始表單標記中的操作適用於我的網站:
<form action="<?php $location = $_SERVER['PATH_INFO'];
echo ''.$location.'#form';?>" method="post">
基本上,您正在獲取當前URL並將其分配給$location
,然后在最后標記#form
它。 因此瀏覽器會將此操作讀取為:
action="currentURL.php#form"
我是這樣做的,因為我的表單是在我的網站的每個頁面上找到的包含,因此需要在向下滾動到表單之前識別其當前位置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.