[英]Display Image Caption on enlarged view
Basically i need to display Image name(caption) when the image in enlarged. 基本上我需要在放大图像时显示图像名称(标题)。 So i tried with this sample code.
因此,我尝试使用此示例代码。
Sample Code for Image Gallery 图片库的示例代码
Demo of the same is given below 相同的演示如下
Now what i want is when the image is enlarged in the left hand side there is a caption Image 1 of 3 . 现在我想要的是,当图像在左侧放大时 ,有一个字幕图像1 of 3 。 Instead of that i need the
Image Caption
ie Image1.png
similar like this. 而不是那样,我需要像这样的
Image Caption
即Image1.png
。
When i opened lightbox js file i found this line where it will display Image 1 of 3 line 当我打开灯箱js文件时,我发现此行将在其中显示3行的图像1
if (this.imageArray.length > 1){
this.numberDisplay.update( LightboxOptions.labelImage + ' ' + (this.activeImage + 1) + ' ' + LightboxOptions.labelOf + ' ' + this.imageArray.length).show();
}
I tried to alter the code by replacing (this.activeImage + 1)
as (this.activeImage.value)
But its showing undefined. 我试图通过将
(this.activeImage + 1)
替换为(this.activeImage.value)
来更改代码,但其显示未定义。
How to display the name of the respective image when the image is enlarged. 放大图像时如何显示各个图像的名称。 Any help appreciated.
任何帮助表示赞赏。
In the PHP code, 在PHP代码中,
Find 找
echo '<li><a href="'.$file.'" rel="lightbox['.$lightbox.']">';
Replace with 用。。。来代替
echo '<li><a href="'.$file.'" rel="lightbox['.$lightbox.']"> title="Whatever Title You Need or get FileName by using php"';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.