天天看點

使用jquery實作監聽事件

$(document).ready(function () {

    $('body').on("click", ".thumbnail", function (e) {

        // console.log(e);

        console.log(e.currentTarget.currentSrc);

        console.log(e.target.dataset.index);

        $('#videoId').attr('src', e.target.dataset.src);

        $(this).addClass('b_FF2E4C').parents('li').siblings().children().children('.thumbnail').removeClass('b_FF2E4C');

    }).on('click', '#returnId', function (e) {

        console.log(e.target);

        // window.history.go(-1);

        // location.replace(this.href);event.returnValue=false;

        // document.parentWindow.location.reload();

        window.location = document.referrer;

        console.log(document.referrer);

    }).on('click', '#closeId', function (e) {

        console.log(e.target);

    }).on('click', '#deleteId', function (e) {

        console.log(e.target);

    }).on('click', '.fastBackward', function (e) {//後退

        speedBackward(0);

    }).on('click', '.pause', function (e) { //暫停

        playPause();

    }).on('click', '.speed', function (e) { //快進

        speedBackward(1);

    });

});

繼續閱讀