简体   繁体   中英

close button with fixed positition not showing in safari (sidr menu)

I am using the jquery plugin sidr to display pop windows, that all have a close button in the top corner overlaid on top of an image.

to keep the button in place I was using the css attribute:

position: fixed;

which works in chrome, but in FF the close button show up in the wrong place and in Safari it doesnt show up at all. changing it to:

position: absolute;

fixed the problem in FF but the button still doesn't show in Safari. with

position: relative; 

the button shows but is then no longer in its correct position.

Help on resolving this issue would be much appreciated! Below is the full code.

html button:

<button id="close" type="button" onclick="$.sidr('close', 'blago');">X</button> 

CSS:

    #close{
    position: relative;
    top: 0;
    margin: 15px;
    background: #000;
    background-color: Transparent;
  background-repeat:no-repeat;
  border: none;
  cursor:pointer;
  overflow: hidden;
}

Never mind, The problem was that left: 0; was not defined which apparently was needed for safari to diplay it in its correct position.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM