javascript 卷軸自動捲到某一元素
$('html, body').animate({
scrollTop: ele.offset().top - 110 + 'px'
}, 1500 ,'easeInOutQuint');[……]
javascript 卷軸自動捲到某一元素
$('html, body').animate({
scrollTop: ele.offset().top - 110 + 'px'
}, 1500 ,'easeInOutQuint');[……]
也不知道為什麼網址列多了一個 index.php
http://127.0.0.1/fastshop.com.tw.ci/index.php/admin/home
修改 .htaccess ,但對我沒效
https://codeigniter.org.tw/userguide3/general/urls.html#index-php
修改設定文件 application/config/config.php
修改這行
$config['index_page'] = 'index.php';
改為
$config['index_page'] = '';
有遇到這問題的朋友,兩種方法不坊都試試
[……]
Fatal error: session_start(): Failed to initialize storage module: user (path: )
開啟CodeIgniter設定檔,預設再 application/config/config.php
把:
改成:
改用 DB session ,必須先連接資料庫,起設定好資料庫連線資訊
開啟CodeIgniter設定檔,預設再 application/config/config.php
把
改成
[……]
今天在開發一個表單程式,表單一直無法發送,開始來找問題,開啟 Chrome 開發者工具,在 Console 面板中,每送出一次表單,就會出現一個這個訊息:
An invalid form control with name=’…’ is not focusable
也對拉!! 必填欄位又隱藏起來,怎麼填? 表單送出前會做一個簡單的表單驗證
這樣也不行:
<input type="text" style="display:none" required>
這樣當然也不行:
<input type="text" id="example" required>
<script>
$('#example').hide();
</script>這樣可以:
大概是原本就是隱藏欄位了,所以沒有特別去驗證
<input type="hidden" required>
開發者會去隱藏欄位當然是有原因的,有時候會因為條件判斷而顯示不同輸入欄位,例如:居住地下拉選單,但使用者可能住於國外,所以表單設計在下拉選單尾端加一個”海外”的選項,選擇了海外,就出現一個自行輸入的文字欄位,像這樣的需求其實蠻常見的,這些輸入欄位通常都只是隱藏起來,依照判斷來顯示,這種欄位當然有可能顯示出來就是必填,下方介紹幾個解決方法來解決這個問題。
在 form 屬性加上 novalidate,關閉預設的表單驗證,表單內的所有欄位都不會進行驗證,除非有其他方式進行表單驗證,不然不建議這麼做。
<form novalidate>
<input type="text" id="example" style="display:none" required>
<input type="submit" value="submit">
</form>在顯示的時候,再加上 required,如此,不管隱藏的文字欄位顯示與否,表單都可以正確送出,文字欄位顯示時,就必須填寫。
<form>
<input type="text" id="example" style="display:none">
<input type="submit" value="submit">
</form>
<hr>
<input type="button" id="show" value="show">
<script>
$('#show').click(function(e){
$('#example').css('display','block').prop('required',true);;
});
</script>這是一個簡單的提示,實務上的做法就看大家如何發揮創意了
[……]
使用 Google reCaptcha 驗證碼進行後端驗證,拋出 invalid-json 錯誤,分享解決這問題的方法:
開啟檢查 PHP.ini 設定,搜尋「allow_url_fopen」,若值不是 On 請改成 On 開啟它,如下:
allow_url_fopen = On
接著搜尋「extension=php_openssl.dll」,確認是否開啟,前方有分號「;」代表沒開啟
;extension=php_openssl.dll
將前方的分號「;」移除,如下:
extension=php_openssl.dll
重新啟動 SERVER
[……]
Warning: file_get_contents(): Unable to find the wrapper “https” – did you forget to enable it when you configured PHP?
需要開啟 php php_openssl 的這個 extension
開啟 php.ini,搜尋:「extension=php_openssl.dll」
;extension=php_openssl.dll
將前方的分號「;」移除
extension=php_openssl.dll
重新啟動 SERVER[……]
官網
https://bootstrap-datepicker.readthedocs.io/en/latest/index.htm
產生器
https://eternicode.github.io/bootstrap-datepicker/
文件
https://bootstrap-datepicker.readthedocs.io/en/latest/index.html[……]
在被垂直居中元素的父類別,加這一段就可以,非常簡單
See the Pen Vertical and horizontal center by VECTOR.cool 威得數位
(@ann71727) on CodePen.
CSS 達成 Div 垂直置中的方法研究 (CSS Vertical Centering Complete Guide)
[……]
在 a 標籤中 href 屬性中,開頭加上 tel:撥打的電話號碼 ,在手機上按下此連結會呼叫手機撥號的應用程式,並把電話輸入在電話欄中,非常方便,但要注意電話號碼格式,只能輸入數字
錯誤:02-2888-8888
正確:0228888888
<a href="tel:0228888888">聯絡我們</a>
[……]