Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Read captions from alt tags as well as title tags #234

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion jquery.nivo.slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@
// Process caption function
var processCaption = function(settings){
var nivoCaption = $('.nivo-caption', slider);
if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){
if((vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined) ||
(vars.currentImage.attr('alt') != '' && vars.currentImage.attr('alt') != undefined)){
var title = vars.currentImage.attr('title');
if(!title){
title = vars.currentImage.attr('alt')
}

if(title.substr(0,1) == '#') title = $(title).html();

if(nivoCaption.css('display') == 'block'){
Expand Down
Loading