Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a bug where nextId was being treated as a string instead of in.…

… Switched from data attribute to jquery.data
  • Loading branch information...
commit d1bea888d9b77f52f77286ca1d29fc4142b6b722 1 parent ef4ff6e
@mattmcmanus authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 jquery.fadeAble.js
View
11 jquery.fadeAble.js
@@ -98,10 +98,11 @@
$('<div></div>').attr('id',options.contextContainerID).css({position:"absolute",bottom:'12px',left:"50%",'z-index':5}).appendTo(container);
//Add the appropriate links for the container
$(options.images).each(function(index){
- $('<a>'+index+'</a>').attr({'title':this.title, 'data-image':index})
+ $('<a>'+index+'</a>').attr({'title':this.title})
+ .data('image',index)
.addClass((index==0)?'current':'')
.click(function(){
- fade($(this).attr('data-image'),container)
+ fade($(this).data('image'),container)
})
.appendTo('#'+options.contextContainerID);
});
@@ -122,11 +123,11 @@
//Figure out what the next index should be
if (nextIndex == 'prev') {
- nextIndex = ( options.current == 0 ) ? options.images.length-1 : options.current-1;
+ nextIndex = ( options.current == 0 ) ? options.images.length-1 : (options.current-1);
} else if(nextIndex == 'next') {
- nextIndex = ( options.current == options.images.length-1 ) ? 0 : options.current+1;
+ nextIndex = ( options.current == options.images.length-1 ) ? 0 : (options.current+1);
}
-
+ console.log(nextIndex)
// Animate the transition
var imgs = $(container).children('a.fadeAble');
imgs.hide();
Please sign in to comment.
Something went wrong with that request. Please try again.