how to select :after element using jquery

前端 未结 4 1166
名媛妹妹
名媛妹妹 2020-12-16 15:25

Bellow is my codes.what i have tried.when this popup appear i want to use this close button to close entire popbox.

CSS code

.bigdiv{
    display:non         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 16:13

    you can use jquery to append close button and can assign an close event to it. This jquery and css will work for you.

    CSS

    .bigdivAfter {
        cursor:pointer;
        position: absolute;
        right: //as you want;
        top: //as you want;
        z-index: 999;
    }
    

    JQUERY

    $(document).ready(function(){ 
    $(".bigdiv").append('');
    $(".bigdiv .closeButton").click(function () {
       $(".bigdiv").hide();
       }) ;
    $(".left div").click(function () {
       $(".bigdiv").show("slow");
    }) ;
    

    I will also suggest you to add image on html itself instead of adding it trough jquery

提交回复
热议问题