-
We need to identify all video iframes. In this case the only iframes that were present were video embeds. With the code below, we are just targeting all iframes.
$("iframe").each(function(){ //Do Something });
$(this).attr('src',ifr_source+wmode);
- Detect source references. For each iframe, we are storing their 'src' reference into a variable.
var ifr_source = $(this).attr('src');
- Create a variable for the new text string. This variable will be added to the end of the src reference.
var wmode = "?wmode=transparent";
- Append the variables into iframe source. All together this is what the javascript should look like.
Hopefully, this tip is a time saver for you. Thong is a Web Developer at DO. He once tried to bribe the office to buy him a Power Rangers Morpher$("iframe").each(function(){ var ifr_source = $(this).attr('src'); var wmode = "?wmode=transparent"; $(this).attr('src',ifr_source+wmode); });
More from the
DO Blog
Designing & Building Product Finder Quizzes for eCommer...
Strategy & Planning / December 23, 2020
View Blog Post3 Customer Motivation Strategies to Improve Your eCommerce i...
Strategy & Planning / July 27, 2020
View Blog Post