var myPlaylist = new jPlayerPlaylist({ jPlayer: "#jquery_jplayer_N", cssSelectorAncestor: "#jp_container_N" }, musicList, { playlistOptions: { enableRemoveControls: true }, // swfPath: "js/", supplied: "webmv, ogv, m4v, oga, mp3", useStateClassSkin: true, autoBlur: false, smoothPlayBar: true, keyEnabled: true, audioFullScreen: true }); $('.jp-play,.jp-mute').click(function() { $(this).toggleClass('on'); }); // // 更新歌曲标题 // function updateTitle() { // var playList = myPlaylist.playlist; // for (var i = 0; i < playList.length; i++) { // if (i === myPlaylist.current) { // $(".jp-music-title").html(playList[i].title + " - " + playList[i].artist); // } // } // try { // if (typeof localStorage === 'object') { // localStorage.setItem('mid', myPlaylist.current); // } // } catch (err) { // console.log(err) // } // } // // 初始化标题 // updateTitle(); // 清空播放列表,只做本地音乐不需要 /*$("#listRemove").click(function() { myPlaylist.remove(); updateTitle(); });*/ // $("#playlist-option-autoPlay-true").click(function() { // myPlaylist.option("autoPlay", true); // }); // $("#playlist-option-autoPlay-false").click(function() { // myPlaylist.option("autoPlay", false); // }); // var $bar = $(".bar"); // var $scrollBar = $(".scrollBar"); // var $maxH = $scrollBar.innerHeight() - $bar.outerHeight(); // var $ul = $(".jp-playlist ul"); // var $li = $(".jp-playlist ul li"); // var disY = 0; // var iScale = 0; // var iSpeed = 0; // $(".jp-playlist-box").mouseover(function() { // addHandler(this, "mousewheel", mouseWheel); // addHandler(this, "DOMMouseScroll", mouseWheel); // return false; // }); // function addHandler(element, type, handler) { // return element.addEventListener ? element.addEventListener(type, handler, false) : element.attachEvent("on" + type, handler, false) // } // function mouseWheel(event) { // var event = event || window.event; // if (event.wheelDelta) { // iSpeed = event.wheelDelta > 0 ? -3 : 3; // } else if (event.detail) { // iSpeed = event.detail < 0 ? -3 : 3; // } // if (event.preventDefault) { // event.preventDefault(); // } // };