Looking to dynamically change two CSS values using jQuery - specifically resizing a Youtube video iframe's width and height when the browser window is resized.
Check out my code snippet:
function resizeWP( width, height ) {
$( "#1" ).text( "RESIZING webpage" );
var layer_width = $( "#red" ).width();
var layer_height = $( "#red" ).height();
var string_width = layer_width.toString();
var string_height = layer_height.toString();
$("#2").text(string_width);
$("#3").text(string_height);
$("iframe").css({"width":"1250px","height":"800px"});
}
$( window ).resize(function() {
resizeWP();
});
I'm almost there, just looking for some assistance to get this working perfectly. Thanks in advance!