jQuery onclick all images in body

后端 未结 3 753
说谎
说谎 2021-01-22 18:02

English isnt my native language so bear with me.

Im trying to make it so that when a user clicks any image on my site a gallery sort of div will become visible containin

3条回答
  •  心在旅途
    2021-01-22 18:13

    var image = $("img");
    
    image.on('click', function(){
        var imageURL = this.src;
        backgroundCurtain.css("display", "block");
        imageResized.attr("src", imageURL);
        var imageWidth = imageResized.width();
        pictureInner.css("width", imageWidth);
    }); ​
    

提交回复
热议问题