模态中的固定元素不保持固定

时间:2015-07-15 02:45:33

标签: javascript jquery html css

我无法将这两个元素保留在模态页面上。 (点击上面的图片图标'模态#2')https://jsfiddle.net/gkrh0ok0/

HTML:

<div class="sidebarRightWork">Information</div>
<button class="remodal-close" data-remodal-action="close"></button>

CSS:

.remodal-close {
cursor: pointer;
-webkit-transition: color 0.2s;
transition: color 0.2s;
z-index: 9;
width: auto;
left: 5%;
position: fixed;
top: 50%;
color: #95979c;
border: 0;
outline: 0;
background: transparent;}

.sidebarRightWork {
right:3%;
position:fixed;
top:50%;
z-index:10;
  }

enter image description here

1 个答案:

答案 0 :(得分:1)

我只关闭了.remodal-close,你可以使用这段代码轻松制作侧边栏。 将此脚本添加到您的js文件中:

 Edit
      ->Preferences
                    ->Editor
                            ->Completions 

演示: https://jsfiddle.net/gkrh0ok0/3/