danielgindi/jquery-backstretch

fadeFirst Not Working?

Closed this issue · 2 comments

I was using the original author's work, but it lacks the fadeFirst option. So, I bumped up t your version which has it but I can't get it to work. There seems to be a number of things potentially problematic on line 515:

  1. the use of "this" rather than "self" - the this reference seems to be an and not the backstretch object.
  2. should the fadeFirstImage property of the options object actually be "fadeFirst" instead?
  3. if I switch both uses of "this" to "self" and switch "fadeFirstImage" for "fadeFirst," images don't load.

I spent some time trying to debug this to try and see why, and I'll keep going, but I figured I'd raise the issue here to see if anyone else might know what's going on.

it appears that the display:none style that's a part of the default CSS for an image as it's being loaded isn't ever being removed. I'm still hunting...

I figured it out and added a PR. In short:

  1. There was some additional this vs. self confusion.
  2. Because the $.fadeIn() method call was in a non-executing else block, even though the image was correctly loading and rotating in the DOM, the element was never actually displayed because of a CSS display: none rule.

The PR should fix it all up.