Luca Luca - 1 year ago 92
HTML Question

Custom popup not opening on Safari

I'm trying to open a custom popup in my website. However, it doesn't work on Safari.

This is how I call it:

<img id="product-1" class="product-box" src="images/image.jpg" onclick="openProduct(1)">

openProduct() does this:

function openProduct(id){
function openPopup(){

It works perfectly good on any other browser, but not in Safari.

Adding an
in the function shows that it calls the function with success. However, I can't see the popup.

If any of you have any suggestion...

Answer Source

The style property should return a CSSStyleDeclaration object that contains key/values for the styles.

Why it works in other browsers seems strange, as the syntax you're using is wrong, it should be

function openPopup(){
    var popup = document.getElementById("popup"); = "1"; = "1000";