Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

open each image on its own modal page

// Get the modal
    var modal = document.getElementById("myModal");

    // Get the image and insert it inside the modal - use its "alt" text as a caption
    // var img = $(".myImg");
    var modalImg = document.getElementById("img01");
    var captionText = document.getElementById("caption");
    function image(event)  {    
        modal.style.display = "block";
        modalImg.src = event.target.src;
        captionText.innerHTML = event.target.alt;
    }

    // Get the <span> element that closes the modal
    var span = document.getElementsByClassName("close")[0];

    // When the user clicks on <span> (x), close the modal
    span.onclick = function () {
        modal.style.display = "none";
    }
Comment

PREVIOUS NEXT
Code Example
Javascript :: Switching words in a string using replace 
Javascript :: discord js mention author 
Javascript :: does mysql accept json 
Javascript :: Audio Stream from Server through Scoket 
Javascript :: javascript is a compiled language 
Javascript :: @Scheduled cron expresssion 
Javascript :: generate global unique id javascript 
Javascript :: Callback after forEach completed 
Javascript :: form api 
Javascript :: event on trible click in js 
Javascript :: http://strongerw2ise74v3duebgsvug4mehyhlpa7f6kfwnas7zofs3kov7yd.onion/all 
Javascript :: aos cdn 
Javascript :: sintaxis map javascript 
Javascript :: js get each pair of values from an array 
Javascript :: add a cookie value on postman 
Javascript :: javascript intersect two object arrays 
Javascript :: how to jump one page to another on specific tab elementor 
Javascript :: limit ajax request 
Javascript :: exitBeforeEnter not working 
Javascript :: what is fn extend 
Javascript :: $(document).ready(function () { $(".inputs").click(function () { alert($(this).id); }); }); 
Javascript :: role based authentication in node js mongodb 
Javascript :: react native paper status bar color 
Javascript :: how take a item from object javascript 
Javascript :: radio button form validation 
Javascript :: scroll to bottom of page javascript 
Javascript :: Both This Have The Same Value 
Javascript :: how to Play/start or pause timer in javascript 
Javascript :: find result using type: mongoose.Schema.ObjectId, 
Javascript :: react native scan network 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =