如果可能的话,有人能给我指个正确的方向吗?
我有一封电子邮件,我想发送给用户的链接到特定的网页。我有模态在那个页面上,我想有网页被打开与特定的模态取决于网址。示例:
domain.com/story/#story1打开带有id为#story1的显示模式的页面
如果有人能帮上忙,我将不胜感激。
我设法在导航到页面时打开了模式窗口
("#Modal8").foundation('reveal', 'open');有人建议我使用
<script>
var hash = window.location.hash;
if (hash === "#story8") {
$('#Modal8').reveal({
animation: 'fadeAndPop', //fade, fadeAndPop, none
animationspeed: 300, //how fast animtions are
closeonbackgroundclick: true, //if you click background will modal close?
dismissmodalclass: 'close-reveal-modal' //element that will close an open modal
}); //You can use same modal or different modal to show success message
}
</script>我试过了,但没有成功。
发布于 2013-11-05 22:53:43
我在我的项目中使用Expressionengine,所以我想出了一个简单的解决方案。也许这会对某人有所帮助。我在页面上有8个情态动词,我有8个条件句,我想你可以在频道中使用条件句。:)
{if last_segment == 'Modal8'} //Modal8 can be changed to any url: latestnews or smth.
$("#Modal8").foundation('reveal', 'open');
</script>
{/if}发布于 2020-07-04 10:13:27
if (window.location.hash){
$(document).ready(function () {
let $blockHash = $(window.location.hash);
//console.log($blockHash);
if (($blockHash.length > 0) && ($blockHash.hasClass('reveal'))){
$blockHash.foundation('open');//foundation 6
}
});
}https://stackoverflow.com/questions/19709485
复制相似问题