【发布时间】:2013-02-01 13:18:26
【问题描述】:
我尝试了在此网站上找到的解决方案。但是,它对我不起作用。我在想有一个脚本在其他地方设置这个,所以我需要在页面中添加一些代码来覆盖样式。
我试过了:
<script type="text/javascript">
$(document).ready(function () {
$("#frame1").width(578);
$("#frame1").height(326);
});
</script>
但是,html 仍然是这样的:
<iframe frameborder="0" src="http://player.vimeo.com/video/20657168?color=fc030f" style="width: 500px; height: 281.25px;"></iframe>
我希望width 成为578 和height 成为326。这是网站:http://beckindesigns.tumblr.com/
附:如果我添加一个类或 ID,它会从 html 中删除它。我正在使用 Tumblr..
【问题讨论】:
-
你的 frame1 id 在哪里?
-
你需要给 iframe
id="frame1". -
Tumblr 正在从视频帖子中删除 ID...
-
@tech0925 更新了我的答案以展示如何在没有 ID 的情况下进行操作。