是指这样的么,创建一个名称FULL的按钮,js代码:
var a=_g().getWidgetByName("FULL").getValue();
if(a=="全屏"){
var a=_g().getWidgetByName("FULL").setValue("退出全屏");
var docElm = document.documentElement;
//W3C
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
}
//FireFox
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
}
//Chrome等
else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
}
}
else{
var a=_g().getWidgetByName("FULL").setValue("全屏");
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}