javascript image overlay over a specified div

前端 未结 2 1752
既然无缘
既然无缘 2021-01-01 07:01

i am new at javascript. very new actually, this ought to be my first script. can anyone explain to me how to make a transparent overlay over any specified fixed width regio

2条回答
  •  暖寄归人
    2021-01-01 07:55

    You can define the overlay such as

    ...contents...

    and define the dimensions and position and z-index etc... in CSS

    .myoverlay {
       position: absolute;
       display: none;
       ...
    }
    

    I don't quite see the need for JavaScript just yet, but I guess you will want to use JS to toggle the overlay's display attribute on/off.

    
    

    Is this roughly what you're after? Sorry for unintentional syntax mistakes, for this is untested code purely off the top of my head. Just to give you an idea.

提交回复
热议问题