在此Div可见后使用Javascript显示弹出窗口

在此Div可见后使用Javascript显示弹出窗口,javascript,Javascript,我想在特定Div出现时显示“共享弹出窗口”。我在我的网站上使用了一个嵌入式测验,用户必须回答多项选择题,然后才能得到结果。result div类被称为result\u screen\u container 我已经有了弹出窗口,但它是被时间触发的。我希望在所有问题完成后,当结果出现时触发它 #popup_box { display:none; position:fixed; _position:absolute; left: 50%; top:

我想在特定Div出现时显示“共享弹出窗口”。我在我的网站上使用了一个嵌入式测验,用户必须回答多项选择题,然后才能得到结果。result div类被称为
result\u screen\u container

我已经有了弹出窗口,但它是被时间触发的。我希望在所有问题完成后,当结果出现时触发它

#popup_box {

    display:none;

    position:fixed;

    _position:absolute; 

    left: 50%;

    top: 50%;

    z-index:10001;

    background:#fff;

    box-shadow: 0px 0px 15px #000;
    border-radius: 8px;

}

#popup_box .inner1 {

    text-align: center;

    padding:0 40px;

    color:#000;

    padding:20px;

}

#popupBoxClose {

    font-size:0;

    right:-22px;

    top:-14px;

    position:absolute;

    cursor: pointer;

    width: 38px;

    height: 37px;

    display: block;

}





/* Popup ends */

#fbshare{width:275px;height: auto;overflow: hidden;}

.inner-fbshare{width:275px;overflow: hidden;}

.inner-fbshare h3{font-size: 19px;margin: 0 0 10px 0;}

.inner-fbshare img{width:275px;height:150px;}

.outer-fbshare{width:275px;height: 45px;overflow: hidden;}

.fbshare_bt

{

    font-size: 22px; background:none repeat scroll 0 0 rgb(64, 94, 159);color:#FFF;

    text-align:center;margin-top:10px;padding: 12px;

    border-radius: 8px;
        font-weight: bold;

}

.fbshare_bt:hover{color:#FFF;text-decoration:none;}

.close_fbshare{float: right;color: #A3A3A3;text-decoration: none;}

.sa-icon.sa-custom {

    background-size: contain;

    border-radius: 0;

    border: none;

    background-position: center center;

    background-repeat: no-repeat;

}

那么,div必须隐藏起来

    var yourDivvisible = document.getElementById("YOURDIVID").style.visibility = "visible";

if(yourDivvisble === true){ */ do something here to display your popup */ }

类似于这样的情况?

如果代码在div可见之前运行,那么它将不起作用。您需要为此设置一个事件哦,是的。如果它被加载并且仍然隐藏,那么它只会被调用一次,永远不会被调用。哎呀。有可能只使用CSS吗?你能提供你的JS吗?如果可能的话我还没有小提琴,对不起。有人告诉我这在Javascript中是可能的,我应该在这里寻求帮助。你能把你的代码发布到你的div出现的地方吗?这将是同一个地方,你会显示你的'分享弹出'可能的副本