天天看点

C# 点击图片全屏

滚轮上下滑动的开关

var transfor = false;

滚轮方法

function wheel(event) {

var delta = 0;

if (event.wheelDelta) {

delta = event.wheelDelta / 120;

}

if (event.detail) {

delta = -event.detail / 3;

}

if (delta) {

handle(delta);

}

if (event.preventDefault) {

event.preventDefault(); }

event.returnValue = false; }

if (window.addEventListener) {

window.addEventListener(‘DOMMouseScroll’, wheel, false);

}

window.onmousewheel = wheel;

function handle(delta) {

if (transfor == true) {

return;

}

//判断滚轮滑动方向

if (delta > 0) {

} else { }

}

全屏

function RequestFullScreen(element) {

var RequestMethod = element.requestFullScreen ||

element.webkitRequestFullScreen ||

element.mozRequestFullScreen ||

element.msRequestFullScreen;

requestMethod.call(element);

}

退出全屏

function ExitFullScreen ()

{

var ExitMethod = document.exitFullscreen ||

document.mozCancelFullScreen ||

document.webkitExitFullscreen ||

document.webkitExitFullscreen;

ExitMethod.call(document);

}

监听全屏

function checkFull() {

var isFull = document.fullscreenEnabled || window.fullScreen || document.webkitIsFullScreen || document.msFullscreenEnabled;

if (isFull === undefined) isFull = false;

return isFull;

}

调用全屏

requestFullScreen($(’’)[0]);

mvc

继续阅读