viewer.js銷燬

1.創建viewer視圖


$(document).on('mousedown','.credentialsImg',function () {
    if($(this).attr('src')){
        $(this).viewer(
            {
                'hidden': function (e) {
                    console.log(e.type);
                },
            }
        );
    }
    else{
        return false;
    }
});

2.銷燬視圖


delImg: function (self) {
    $(self).parent().find('img').attr('src','');
    $(self).parent().find('img').removeClass('credentialsImg');
    $(self).parent().find('img').viewer('destroy');
    $(self).parent().find('img').data('src','');
    $(self).css('z-index','-2');
    $('#'+$(self).parent().find('img').attr('id')).off('click');
    $('#'+$(self).parent().find('img').attr('id')).on('click',function(){
        tool.upLoad($(self).parent().attr('id'),$(self).parent().attr('id').replace(/upload/,''),$(self).parent().find('img').attr('id'));
    })
},

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章