DIV放大到窗口大小点击 [英] DIV enlarge to window size on click

查看:176
本文介绍了DIV放大到窗口大小点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jquery的帮助,在新内容或div的布局点击时将div放大到全屏。实际上,我做一个小的网页,一些文本或图像写在一个网页上,当我点击那个div它大到窗口大小,更多的细节关于smalle div的内容。

How to enlarge a div to full screen on click with new content or layout of that div with the help of jquery. Actually i am making a div that is small in a webpage with some text or images written over that div and when i click on that div it go large to window size with more details about the content on the smalle div .

推荐答案

如果我理解正确,你已经有办法放大DIV,所以它覆盖您的文档,现在您希望它全屏。如果是这种情况,请检查 html5全屏API 。请注意,这是目前的工作草稿,因此您需要检查浏览器的兼容性,并相应地使用前缀。

If I understand correctly, you already have the means to enlarge the DIV so it covers your document, and now you want it to go fullscreen. If that is the case check the html5 full screen API. Please note this is currently a working draft so you need to check compatibility of the browser and use the prefixes accordingly.

只要我们正在谈论全屏,那么你是运气好的,因为已经有一个JQuery插件: http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/ [演示]

As long as we are talking about fullscreen, then you are in good luck, because there is already a JQuery plugin for that: http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/ [Demo]

使用插件这是相关代码:

Using the plugin this is the relevant code:

window.fullScreenApi.requestFullScreen(fsElement);

这篇关于DIV放大到窗口大小点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆