Lightbox2:如何添加&#34; EDIT&#34; <a> between the &#34;lb-prev&#34; and &#34;lb-next&#34; divisions?

时间:2016-01-18 07:27:33

标签: javascript css lightbox2

I am using lightbox2 from " http://lokeshdhakar.com/projects/lightbox2/&#34 ;.我有一切按预期工作,但我想添加一个&#34; EDIT&#34;功能所以我可以打开一个页面,允许我通过IPTC将数据添加到jpg图像文件中。我试图放一个&#34; <a>&#34; &#34; lb-prev&#34;和&#34; lb-next&#34;在.js文件中的锚点,我修改了.css文件以包含&#34; lb-edit&#34;然后调整宽度,但是当图像显示时,&#34; lb-next&#34;是在容器下面。 css for&#34; lb-prev&#34;有&#34;浮动:左&#34;并且&#34; lb-next&#34;有&#34;浮动:对&#34;但如果我把东西放在中间,那么&#34; lb-next&#34;掉下来。我试过&#34;显示:内联&#34;无济于事。谢谢。片段如下:

lightbox.js有:

`<div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-edit" href=""></a><a class="lb-next" href="" ></a></div>`

...和...

this.$lightbox.find('.lb-edit').on('click',function() {

  window.location.href="../../lb-edit.php"

});

lightbox.css有:

.lb-prev, .lb-edit,.lb-next {
height: 100%;
cursor: pointer;
display: block;
}

`.lb-nav a.lb-prev {
 width: 33%;
 left: 0;
 float: left;
 background: url(../images/prev.png) left 48% no-repeat;
 filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
 opacity: 0;
 -webkit-transition: opacity 0.6s;
 -moz-transition: opacity 0.6s;
 -o-transition: opacity 0.6s;
 transition: opacity 0.6s;
 }

 .lb-nav a.lb-prev:hover {
 filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
 opacity: 1;
 }
 .lb-nav a.lb-edit {
 width: 34%;
 left: 0;
 margin-right:auto;margin-left:auto;
 background: url(../images/edit.png) left 48% no-repeat;
 filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
 opacity: 0;
 -webkit-transition: opacity 0.6s;
 -moz-transition: opacity 0.6s;
 -o-transition: opacity 0.6s;
 transition: opacity 0.6s;
 }
.lb-nav a.lb-edit:hover {
 filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
 opacity: 1;
 }  
 .lb-nav a.lb-next {
 display:inline;
 width: 33%;
 right: 0;
 float: right;
 background: url(../images/next.png) right 48% no-repeat;
 filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
 opacity: 0;
 -webkit-transition: opacity 0.6s;
 -moz-transition: opacity 0.6s;
 -o-transition: opacity 0.6s;
 transition: opacity 0.6s;
 }

 .lb-nav a.lb-next:hover {
 filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
 opacity: 1;
 }

1 个答案:

答案 0 :(得分:0)

关闭这个...我更改了lb-prev,lb-next和lb-edit的顺序,这样两个&#34;结束&#34;首先渲染碎片,然后编辑&#34;编辑&#34;部分适合中间。上帝,但我喜欢这个东西!!!