使用 w3.css 自动打开模态
auto open modal with w3.css
所以我试图在 password/username 输入错误时打开我的模式。
我已经搜索过 google,但我无法想出一个很好的解决方案来解决如何使用 W3.CSS
执行此操作。
我的模态由一个名为 "id01"
的 ID
打开,然后我尝试了一个小的 javascript,我在 Whosebug 中找到了:Open modal with # in url。
在 W3.CSS
的帮助下尝试将其编辑为:
function popModal() {
modal.style.display = "block";
}
var hash = window.location.hash;
if (hash.substring(1) == 'id01') {
popModal();
}
还是不行。所以长话短说。当 url 中的 "#1234"
?
时,如何打开模式
试试这个:
$( document ).ready(function() {
//console.log( window.location.href );
if(window.location.href.indexOf("#1234") > -1) {
alert("your url contains #1234");
popModal();
}
});
所以我试图在 password/username 输入错误时打开我的模式。
我已经搜索过 google,但我无法想出一个很好的解决方案来解决如何使用 W3.CSS
执行此操作。
我的模态由一个名为 "id01"
的 ID
打开,然后我尝试了一个小的 javascript,我在 Whosebug 中找到了:Open modal with # in url。
在 W3.CSS
的帮助下尝试将其编辑为:
function popModal() {
modal.style.display = "block";
}
var hash = window.location.hash;
if (hash.substring(1) == 'id01') {
popModal();
}
还是不行。所以长话短说。当 url 中的 "#1234"
?
试试这个:
$( document ).ready(function() {
//console.log( window.location.href );
if(window.location.href.indexOf("#1234") > -1) {
alert("your url contains #1234");
popModal();
}
});