Skip to content

Commit b57d6f7

Browse files
committed
Extract title also form the alt attribute of a contained image
At this time we needed to specify the title attribute and the alt attribute redundant.
1 parent 8e0c836 commit b57d6f7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Swipebox is a jQuery "lightbox" plugin for desktop, mobile and tablet.
1212

1313
##Changes in this fork
1414
- Build and deploy swipebox in the cloud by travis-ci.org
15+
- Extract title also form the alt attribute of a contained image
1516

1617
##Features
1718

src/js/jquery.swipebox.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116

117117
if ( $( this ).attr( 'title' ) ) {
118118
title = $( this ).attr( 'title' );
119+
} else if ( $( this ).find( 'img' ).attr( 'alt' ) ) {
120+
title = $( this ).find( 'img' ).attr( 'alt' );
119121
}
120122

121123

0 commit comments

Comments
 (0)