• I’m using below overlay image code in my WordPress single.php file.

    <div onclick="myFunction()" id = "xx1" style="position: absolute; width: 209px; height: 607px; z-index:400" >
            <img src = "https://i.imgur.com/YqqQj2x.png"></img>
        </div> 
    
     <script>
        function myFunction() {
            element = document.getElementById("xx1");
            img = element.firstChild;
            element.removeChild(img);
        }
        </script>

    My problem is that Overlay image is not working in touch browsers, Can anyone help me to modify the code to work with touch browsers(Mobile browsers).

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mashrano

    (@mashrano)

    hey…can anyone help…

    Add touchstart=”myFunction()” click events only work on input and links on touch screens … Since there’s no mouse there’s no click … I didn’t test that but it’ll probably work

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Overlay image is not working in touch browsers’ is closed to new replies.