简体   繁体   English

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

[英]How to open new page without refresh in full-screen mode using jquery

I want to open a page without refreshing and changing current mode (full-screen mode) in jquery, In my page the full-screen is open by default and I would like to redirect users in another page without exiting full-screen and with refreshing.我想在 jquery 中打开一个页面而不刷新和更改当前模式(全屏模式),在我的页面中,默认情况下全屏是打开的,我想在另一个页面中重定向用户而不退出全屏并刷新.

I use history.pushState() but it doesn't work for me.我使用history.pushState()但它对我不起作用。 Here's a small piece of my code这是我的一小部分代码

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

Hope you will understand, please help to solve my problem.希望你能理解,请帮助解决我的问题。

This should work:这应该有效:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM