Tag: 屏幕

JS“窗口”宽度 – 高度与“屏幕”宽度 – 高度?

当我看到这段代码时,我想知道一点: // Get the screen height and width var maskHeight = $(document).height(); var maskWidth = $(window).width(); … // Get the window height and width var winH = $(window).height(); var winW = $(window).width(); $(document).height();什么区别$(document).height(); 和$(window).height(); ?

使用javascript更改体宽

我刚才知道我们可以使用screen.width和screen.height等找出我们用户的屏幕分辨率。但是有没有办法有一个可变的体宽。 我的意思是我可以使用jquery或javascript设置body width属性。 这将随着每个用户的分辨率而改变,以便我的网站在所有用户中看起来都很完美…… 任何人都可以帮助我根据通过上面的Jscript获得的值设置代码来设置页面的宽度(CSS)。 谢谢

Html5video – 在屏幕上点击播放/暂停video

,嗨, Play/Pause Big Small Normal Your browser does not support HTML5 video. var myVideo=document.getElementById(“video1”); function playPause() { if (myVideo.paused) myVideo.play(); else myVideo.pause(); } function makeBig() { myVideo.width=560; } function makeSmall() { myVideo.width=320; } function makeNormal() { myVideo.width=420; } Video courtesy of Big Buck Bunny. 我尝试使用以下网站的html5video http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video_js_prop 如何在video屏幕上播放/暂停video? 任何帮助将不胜感激。 谢谢。

如何相对于点击定位400 x 400px popup div,保持在屏幕视图中

最好使用jQuery,因为它更容易理解。 以下工作非常适合水平。 问题是垂直可以在顶部切断,要求用户向上滚动以查看整个弹出窗口。 function pop_IT(X,event){ dist_to_right_edge = $(‘body’).innerWidth()-(x-$.scrollbarWidth()); dist_to_bottom = $(window).height()-y; X=$(‘#’+X).get(0); X.style.left = 5+x+”px”; X.style.top = 5+y+”px”; if(dist_to_right_edge < (X.offsetWidth+5)){X.style.left = x – X.offsetWidth-5+"px";} if(dist_to_bottom < (X.offsetHeight+5)){X.style.top = y – X.offsetHeight-5+"px";} } 然后我加载类似的东西 $(‘#object’).load(‘../whatever.php’,function(event){pop_IT(‘object’,event);});

如何在jquery中检测屏幕分辨率是否发生变化?

如何使每次用户更改屏幕分辨率大小[不是浏览器窗口]时,页面执行function?

使用Javascript / Jquery禁用桌面Web浏览器中页面的缩放

可能重复: 如何在所有现代浏览器中检测页面缩放级别? var obj=document.body; // obj=element for example body // bind mousewheel event on the mouseWheel function if(obj.addEventListener) { obj.addEventListener(‘DOMMouseScroll’,mouseWheel,false); obj.addEventListener(“mousewheel”,mouseWheel,false); } else obj.onmousewheel=mouseWheel; function mouseWheel(e) { // disabling e=e?e:window.event; if(e.ctrlKey) { if(e.preventDefault) e.preventDefault(); else e.returnValue=false; return false; } } 我正在开发一个Web应用程序,如果用户放大/缩小,所有ui元素的顺序将不正确。 那么,有什么方法可以阻止它吗? 我想到了某种方法,但它有可能吗? 1)获取用户的屏幕分辨率。 当窗口大小改变(宽度或高度)时,将窗口宽度/高度返回到屏幕宽度/高度。 2)将鼠标滚动事件或键盘事件绑定为空。 (请参阅上面的演示代码),但如果用户单击浏览器并选择放大,该怎么办? 谢谢