Last active
August 29, 2015 14:21
-
-
Save linkarys/39a7e3f97aba1662e7fb to your computer and use it in GitHub Desktop.
Xiami musci unlike button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var $player = $('#J_playTracksList'), | |
$controls = $player.find('.ui-track-control'); | |
$player.off('click.xm.hate').on('click.xm.hate', '.no-more', function() { | |
var id = $(this).closest('.ui-track-item').data('sid'); | |
$.get('http://www.xiami.com/kuang/unlike', $.param({id: id})); | |
console.log('unlike id:', id); | |
}); | |
$controls.each(function(index, ctrl) { | |
var $ctrl = $(ctrl), | |
$noMore = $ctrl.find('.no-more'); | |
if ($noMore.length) return; | |
$noMore = $('<a class="delete-btn amend dislike no-more icon-track-delete" data-type="track" data-event="delete" title="不在播放"></a>'); | |
$noMore.css({ | |
'right': '116px', | |
'background-position': '0 -448px' | |
}); | |
$ctrl.append($noMore); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment