9
$('#song-link').change(function() {
var link = $('#song-link').val();
SC.oEmbed(link, {
element: document.getElementById('putTheWidgetHere')
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://connect.soundcloud.com/sdk/sdk-3.1.2.js"></script>
<input id="song-link" placeholder="Paste Soundcloud link here" name="song_link" type="text">
<div id="putTheWidgetHere"></div>
代码可以帮助我的SoundCloud预览的链接。你可以测试它的工作正常。但我想将其高度从400px
更改为200px
。我曾尝试加入addclass()
和css()
。但它没有奏效。
我无法确定哪个事件会触发这些功能,因为必须在将链接粘贴到输入文本上并将其加载到加载了loudcloud的iframe
上之后设置高度。
您应该添加“我问为200px”的意见,它不能编辑到答案@Saugat塔帕 – Zentryn
哦哈哈抱歉...我会的。我的编辑选项现在被禁用 –