How do I set a document property (such as document.webkitFullscreenElement) to null?

时间:2016-02-12 19:54:47

标签: javascript html

When the fullscreen button of a html5 video tag is clicked in an Android WebView, document.webkitFullscreenElement is set to the video that i clicked on (according to the print out of it). Is there a way I can manually set this to null?

before i hit fullscreen on the video

console.log(document.webkitFullscreenElement); //null

after I hit fullscreen on the video

console.log(document.webkitFullscreenElement); //[object HTMLVideoElement]

set to null

document.webkitFullscreenElement = null;

after set to null

console.log(document.webkitFullscreenElement); //[object HTMLVideoElement]

2 个答案:

答案 0 :(得分:1)

That’s not an editable property, but you could create your own feature detection variable:

var hasFullscreenEl = !!document.webkitFullscreenElement;

Then you could set it to null later. Not exactly sure what the use case is here, so let me know if this isn’t helpful.

答案 1 :(得分:0)

I ended up figuring it out. I just need to manually call this.

Sub TestMatch2()

    Dim d, arr1, arr2, r
    Set d = CreateObject("scripting.dictionary")

    'get the data in arrays
    arr1 = Range("A1:A700000").Value
    arr2 = Range("E1:E7000").Value

    'put the smaller list in the dictionary
    For r = 1 To UBound(arr2, 1)
        If Not d.exists(arr2(r, 1)) Then d.Add arr2(r, 1), 1
    Next r

    'check the larger list against the dictionary,
    '   modifiying the array as we go
    For r = 1 To UBound(arr1, 1)
        arr1(r, 1) = IIf(d.exists(arr1(r, 1)), 1, "")
    Next r
    'populate the result column
    Range("A1:A700000").Offset(0, 1).Value = arr1

End Sub