简体   繁体   English

Safari中不显示固定位置的关闭按钮(SIDR菜单)

[英]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. 我正在使用jquery插件sidr来显示弹出窗口,所有窗口的上角都有一个关闭按钮,它们覆盖在图像的顶部。

to keep the button in place I was using the css attribute: 保持按钮在我使用css属性的位置:

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. 该工具在chrome中有效,但在FF中,关闭按钮显示在错误的位置,而在Safari中则完全不显示。 changing it to: 更改为:

position: absolute;

fixed the problem in FF but the button still doesn't show in Safari. 解决了FF中的问题,但该按钮在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: html按钮:

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

CSS: 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; 没关系,问题是left: 0; was not defined which apparently was needed for safari to diplay it in its correct position. 没有定义,野生动物园显然需要将其显示在正确的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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