如何使用jQuery在全屏模式下打开新页面而不刷新

问题描述 投票:0回答:1

我想打开一个页面,而不刷新和更改 jQuery 中的当前模式(全屏模式),在我的页面上,默认情况下全屏打开,我想将用户重定向到另一个页面而不退出全屏,令人耳目一新。

我使用

history.pushState()
,但它对我不起作用。 这是我的一小段代码

<a onclick="history.pushState({},'Another page','./anotherpage?t=abc');" class="btn waves-effect waves-light orange" style="margin-top: 45px; width: 98%;">Next</a>

希望您能理解,请帮助解决我的问题。

javascript html jquery fullscreen
1个回答
2
投票

这应该有效:

<a onclick="openFullscreen()" class="btn waves-effect waves-light orange" style="margin-top: 45px; width: 98%;">Next</a>

<script>
    function openFullscreen() {
        var win = window.open('https://example.com','full','dependent=yes, fullscreen=yes');
        win.focus();
    }
</script>
© www.soinside.com 2019 - 2024. All rights reserved.