Skip to content

Commit c47ac57

Browse files
committed
Merge pull request dimsemenov#34 from ciotto/image_description
add image description to gallery image
2 parents 17c5617 + 3ebdeb7 commit c47ac57

File tree

4 files changed

+61
-79
lines changed

4 files changed

+61
-79
lines changed

content-ds-gallery.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,16 @@
136136
} else {
137137
$img_scale = '';
138138
}
139+
140+
$desc = get_post( $attachment_id_item )->post_content;
141+
142+
139143

140144
if(!$alt_attr)
141145
$alt_attr = $image_urls[$j];
142146

143-
$album_data .= "\t\t<li class=\"two-dim-item\"{$video_data}{$img_scale} data-img-width=\"{$image_widths[$j]}\" data-img-height=\"{$image_heights[$j]}\"><a href=\"{$image_urls[$j]}\">{$alt_attr}</a>";
147+
$album_data .= "\t\t<li class=\"two-dim-item\"{$video_data}{$img_scale} data-img-desc=\"{$desc}\" data-img-width=\"{$image_widths[$j]}\" data-img-height=\"{$image_heights[$j]}\">";
148+
$album_data .= "<a href=\"{$image_urls[$j]}\">{$alt_attr}</a>";
144149

145150
$album_data .= "</li>\n";
146151
$j++;

css-less/two-dim-slider.less

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,38 @@
510510
}
511511
}
512512

513+
.img-desc-block {
514+
-webkit-text-size-adjust:none;
515+
position: absolute;
516+
overflow: auto;
517+
z-index: 50;
518+
519+
padding: 0;
520+
521+
background: @sidebar-background;
522+
523+
left: 0;
524+
top: 0px + @gallery-padding;
525+
max-width: 65%;
526+
527+
color: @sidebar-text-color;
528+
529+
.info-container {
530+
width: auto;
531+
height: auto;
532+
padding: 1.0em;
533+
}
534+
h3.album-title {
535+
margin-top: 0;
536+
}
537+
.img-content {
538+
font-size: @font-small;
539+
line-height: @font-small-line-height;
540+
margin: 0;
541+
max-height: 300px;
542+
overflow: auto;
543+
}
544+
}
513545

514546

515547

0 commit comments

Comments
 (0)