我用Flot来绘制我的一些数据,我想在点击一个按钮后,让这个图形全屏显示(占据显示器上的全部空间)会很好.目前,我的div如下:

<div id="placeholder" style="width:800px;height:600px"></div>

Of course, the style attribute is only for testing. I will move this to CSS after during the actual design. Is there anyway I could make this div fullscreen and still preserve all event handling?

推荐答案

当你说"全屏"时,你的意思是计算机的全屏,还是占据浏览器的整个空间?

You can't force the user into full-screen F11; however, you can make your div full screen by using the following CSS

div {width: 100%; height: 100%;}

This will of course assume your div is child of the <body> tag. Otherwise, you'd need to add the following in addition to the above code.

div {position: absolute; top: 0; left: 0;}

Jquery相关问答推荐

Bootstrap 4 多选下拉菜单

在 JavaScript 中解析 URL

jQuery .get 错误响应函数?

JavaScript 吸管(告诉鼠标光标下像素的 colored颜色 )

jQuery.parseJSON 与 JSON.parse

调整浏览器大小时调整jqGrid的大小?

jQuery 序列化不注册复选框

如何重新启用 event.preventDefault?

您如何处理 jQuery 中的表单更改?

带有 jquery.animate() 的 CSS 旋转跨浏览器

为什么不推荐$().ready(handler)?

如何使用jquery获取点击链接的href?

C# String.IsNullOrEmpty Javascript 等效项

使用 AJAX 加载 Bootstrap 弹出内容.这可能吗?

Jquery:如何判断元素是否具有某些 css 类/样式

如何在 TypeScript 中获得 jQuery 自动完成功能?

带有函数的 JavaScript 三元运算符示例

如何使用 bootstrap 中的 selectpicker 插件在 Select 时设置选定值

AJAX 成功中的 $(this) 不起作用

小于 10 给数字加 0