Billy
(BIlly)
1
I’m trying to unload an iframe so it stops video playing.
This works but I want to use classes instead as I don’t want to create unique id’s for every video!
hypeDocument.getElementById("vimeovideo1").innerHTML = ' '
I tried these but none work:
hypeDocument.getElementsByClassName("vimeovideo").innerHTML = ' '
and
hypeDocument.getElementById(hypeDocument.documentId()).getElementsByClassName("vimeovideo").innerHTML = ' '
Help apprecieted.
1 Like
MrAddy
(Andrew)
2
I would use jQuery if you want to grad elements by class.
Billy
(BIlly)
3
Ok so how would I do that?
I need it to be part of hype and not called up externally in html page though.
MrAddy
(Andrew)
4
jquery-2.1.3.js.zip (72.4 KB)
Drop this into the resources file, and make sure its ticked at the bottom to include in the header, and then use something like:
$('.vimeovideo').text('');
Billy
(BIlly)
5
Ta. That did the job. Shame have to load the resource but at least it works for classes now. Cheers.
rene
(René)
6
This will give you an array of all elements with this classname. You'll have to loop this thru like:
var i
var vElements = document.getElementsByClassName("vimeovideo")
for (i = 0; i < vElements.length; i++) {vElements[i]. innerHTML = '';}
can someone explain where to add this code exactly? Many thanks!
DBear
9
You would put this in a function and call it whenever you want. Say on mouse click of an element.
But, I wouldn’t just empty the contents. I would use the video.pause method but hey that’s just me.
chansi12
(chans)
10
How to display video again? help me please.