In the context of the function, this refers to document, so when you do $(document).find('.flex-video') and then set the iframe src to about:blank, all videos on the website are dying.
The huge problem is that this method is also called by alert-boxes, dropdowns and so on.
},
close_video : function (e) {
- var video = $(this).find('.flex-video'),
+ var video = $(e.target).find('.flex-video'),
iframe = video.find('iframe');
if (iframe.length > 0) {
},
open_video : function (e) {
- var video = $(this).find('.flex-video'),
+ var video = $(e.target).find('.flex-video'),
iframe = video.find('iframe');
if (iframe.length > 0) {