Javascript 我怎样才能有一个全宽spotify播放列表嵌入iframe?
我已经通过spotify播放列表iframe enbed选项在我的站点中创建了一个嵌入 我想让它全宽,这就是我到目前为止所做的:Javascript 我怎样才能有一个全宽spotify播放列表嵌入iframe?,javascript,jquery,iframe,spotify,Javascript,Jquery,Iframe,Spotify,我已经通过spotify播放列表iframe enbed选项在我的站点中创建了一个嵌入 我想让它全宽,这就是我到目前为止所做的: $(window).resize(function() { $('#playlist-container iframe[src*="embed.spotify.com"]').each( function() { var widthC = $('#playlist-container iframe[src*="embed.spotify.com
$(window).resize(function() {
$('#playlist-container iframe[src*="embed.spotify.com"]').each( function() {
var widthC = $('#playlist-container iframe[src*="embed.spotify.com"]').find('#outerWidgetContainer');
widthC.css('width',$(this).parent().css('width'));
$(this).css('width',$(this).parent().css('width'));
$(this).attr('src',$(this).attr('src'));
});
});
问题是这个元素“#outerwidgetcainer”
的内联样式为320px
理想的情况是,如果我可以访问元素并去掉该宽度
这可能吗?为什么这一行
$(this.attr('src',$(this.attr('src'))代码>?这是为了将src url存储为变量,这样就不会丢失