Youtube video popup link

Asked

Viewed 16 times

0

I need to create a link in an image where when clicking on the image opens a popup centered on the screen with the youtube video, this working but what I did not know if it would be correct, someone can help me?

Link=>

<a <label onclick="PopupCenter('https://www.youtube.com/embed/INQcOCgpOXs','785','680')"
                             style="cursor:pointer;"></label>
                    <img style="margin-right: -4.5px; border:solid 1px #ffffff" class="espaco"  src="imagens/thumb/atomizador_250lts_25_thumb.png" alt="" />
                    </a>

Popup script =>

<script type="text/javascript"> function PopupCenter(pageURL, title, w, h) {
        var left = (screen.width / 2) - (w / 2);
        var top = (screen.height / 2) - (h / 2);
        var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=650px' + w + ', height=450px' + h + ', top=100%' + ', left=' + left);
    }
    </script>
  • The syntax of your link is confused. Can you review? There is an element label being defined within a a.

  • Yes, I don’t know much yet, I followed some explanations on google and I did so, this working but I don’t know if it’s the right thing to do.

  • Yes I created again, because this question here nobody answered me, it seems people just want to give the first comment and then do not care more with the question. We have to be lucky for the first one to answer because then nobody comments. So I had to create another question, because this Anderson Carlos who answered, just wanted to answer and helped in anything, and no one else commented to help me. Then I asked another question and there they helped me to solve.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.