これは、「Rock the house!」というリンクをクリックしたときに Spotify Play ボタンを表示する jQuery コードです。
$(function() {
$('#partystart').toggle(function () {
$(".fadeIn").addClass("party");
$("#musicbox").slideDown("300");
$("#partystart").html("<a id='partystart'>Take a break</a>");
}, function () {
$(".fadeIn").removeClass("party");
$(".fadeIn").addClass("fullopacity");
$("#musicbox").slideUp("300");
$("#partystart").html("<a id='partystart'>▲ Rock the house!</a>");
});
});
HTMLは次のとおりです。
<div id="partybox" >
<iframe id="musicbox" style="margin-top: -2px; display: none;" src="https://embed.spotify.com/?uri=spotify:track:3QMLpta0AmeJLpWNmeyC6B#0:12" width="250" height="80" frameborder="0" allowtransparency="true"></iframe>
<a id="partystart">▲ Rock the house!</a>
</div>
以下は、実際の Spotify の再生ボタン内の再生ボタンではなく、円をクリックしてトラックを再生できる例です: http://spotifymusic.tumblr.com/
また、#0:12
曲の URI の最後に 0:12 秒で再生を開始するようにしましたが、うまくいかないようです。私はそこで何が間違っていますか?
ありがとう!