Skip to content

Instantly share code, notes, and snippets.

@linkarys
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linkarys/39a7e3f97aba1662e7fb to your computer and use it in GitHub Desktop.
Save linkarys/39a7e3f97aba1662e7fb to your computer and use it in GitHub Desktop.
Xiami musci unlike button
(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