-1
我想在屏幕更改(完整/默認)上添加一個事件。給定的功能很好地工作在Chrome中,但不能在Firefox中工作。mozfullscreenchange不工作在Firefox中
if (myid.addEventListener){
myid.addEventListener('webkitfullscreenchange' , changeScreen , false)
myid.addEventListener('mozfullscreenchange' , changeScreen , false)
myid.addEventListener('fullscreenchange' , changeScreen , false)
myid.addEventListener('MSwebkitfullscreenchange' , changeScreen , false)
}
else {
myid.attachEvent('fullscreenchange' , changeScreen)
}
function changeScreen(){
if (mydiv.id != 'oldid') {
mydiv.id = 'oldid'
}
else {
mydiv.id = 'newid'
}
}
我該怎麼去錯了。請不要J查詢。只有JavaScript。