简体   繁体   English

Fancybox说明框

[英]Fancybox description box

i'm trying to create a description box to the left of the pop-up image such as this: http://postimg.org/image/4a44hyz71/73ae3809/ 我正在尝试在弹出图像的左侧创建一个描述框,例如: http : //postimg.org/image/4a44hyz71/73ae3809/

now i used the following method to get someplace to write my description and have thumbnails. 现在,我使用以下方法在某个地方写我的描述并有缩略图。 JSFIDDLE Demo JSFIDDLE 演示

JQUERY: JQUERY:

$('.fancybox').fancybox({
prevEffect : 'fade',
nextEffect : 'fade',
padding:0,
closeBtn  : true,
arrows    : true,
nextClick : true,    

helpers : { 
title : { type : 'outside' }
},
helpers : {
thumbs : {
width  : 80,
height : 80

}
},


beforeLoad: function() {
this.title = $(this.element).attr('caption');
}

});

HTML: HTML:

<a caption="Early 1900'....." rel="Sold" class="fancybox" data-fancybox-group="thumb1" 
href="http://fancyapps.com/fancybox/demo/4_b.jpg">  <img src=" "alt="" /></a>

Is this considered a correct method, and can the caption take such input as in the image at the beginning of the post. 这是否被认为是正确的方法,标题可以接受帖子开头的图片中的输入吗? Also how can i place the description box to the left of the pop-up image and give it the same height whilst keeping it responsive to window re-sizing? 另外,如何将描述框放置在弹出图像的左侧,并赋予其相同的高度,同时又能使其对窗口的大小作出响应?

I hope this is getting close to what you want to achieve: http://jsfiddle.net/arjbb9xc/1/ 我希望这已经接近您要实现的目标: http : //jsfiddle.net/arjbb9xc/1/

The downside is the description will go out of view when the window is too small. 缺点是,如果窗口太小,说明将无法显示。 In order to take care of that issue we would have to include some nasty javascript that could possible cause problems with fancybox. 为了解决该问题,我们必须包含一些讨厌的javascript,这可能会导致fancybox出现问题。

Note: If you ever want to just add a small title to your fancybox images, just add a title="your description" to the <a> tag. 注意:如果您只想在fancybox图像中添加一个title="your description" ,只需在<a>标记中添加title="your description" However, because you want to use headers and paragraphs in your description the approach you made seems legit. 但是,由于要在描述中使用标题和段落,因此您采取的方法似乎合法。

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

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