jquery点击图片显示大图

/*前端代码*/
            
  • 其它证件
  • /*CSS代码*/
     /*全屏显示*/
        .fullScreen {
            display: none;
            background-color: rgba(0, 0, 0, 0.5);
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 111;
            transition: all .3s;
        }
        .fullScreen div {
            position: relative;
            width: 100%;
            height: 100%;
        }
        .fullScreen div img {
            position: absolute;
            width: 100%;
            top: 50%;
            left: 0;
            transform: translateY(-50%);
    
    /*JS函数*/
    //全屏显示
        function fullScreen(t) {
            $('.fullScreen').css('display', 'block').children('div').children('img').attr('src', $(t).attr('src'))
        }
    

    你可能感兴趣的:(jquery点击图片显示大图)