jquery-backstretch / jquery-backstretch

Backstretch is a simple jQuery plugin that allows you to add a dynamically-resized, slideshow-capable background image to any page or element. The image will stretch to fit the page/element, and will automatically resize as the window/element size changes.
http://www.jquery-backstretch.com
MIT License
3.92k stars 911 forks source link

Slideshow Next|Prev Sample Page #221

Closed sneil69 closed 11 years ago

sneil69 commented 11 years ago

Thanks for the code but is there a working sample page online or to download I could see?

charyorde commented 11 years ago

Just checked this link and the next prev function is not working.

srobbin commented 11 years ago

I just added a new way to call prev/next on a Backstretch slideshow:

// First, create a Backstretch slideshow
$.backstretch([
  "path/to/first.jpg",
  "path/to/second.jpg",
  "path/to/third.jpg"
]);

// You'll probably attached the prev/next calls to some sort of click event
$("a#next").click(function () {
  // Just call Backstretch again, and pass in the prev/next command
  $.backstretch("next");

  return false;
});
kamescg commented 11 years ago

I can confirm that the "Next" feature is still not working.

I'm attaching the click event to Drupal's View Module that has a slideshow overlayed on top of a large background image area.

srobbin commented 11 years ago

@KamesG Can you please provide a link to the page that's not working?

kamescg commented 11 years ago

Wow! You're quick ;)

Absolutely. The website is www.gregbrockbank.us

I am using the following to handle the next event...

(function($) { $().ready(function() {

// First, create a Backstretch slideshow $('#section-header').backstretch([ 'sites/all/themes/locali/images/bg/mt_tam.jpg', 'sites/all/themes/locali/images/bg/downtown_san_rafael_bw.jpg' ]);

// You'll probably attached the prev/next calls to some sort of click event $("#views_slideshow_controls_text_next_slideshow-block a").click(function () { // Just call Backstretch again, and pass in the prev/next command $.backstretch("next");

return false; });

}); })(jQuery);

srobbin commented 11 years ago

Ah, I see what's happening. You'll need to call Backstretch's next method on the original section:

$('#section-header').backstretch("next");
kamescg commented 11 years ago

Hi @srobbin

I really appreciate your help figuring this out. I added the obvious ('#section-header') to backstretch next, but for some reason it's still not working.

I also added a duration of 99999 to the images, so the image wouldn't rotate every couple of seconds or so.

srobbin commented 11 years ago

It looks like the issue is related to something other than Backstretch itself. Rather, you've got multiple versions of jQuery, and a custom noConflict script. All of which is resulting in an error message saying that the "on" method can't be found for jQuery.

Unfortunately, this is beyond the scope of help that I can offer. Best of luck.

kamescg commented 11 years ago

Totally understandable.

If you are available for hire I would love to have your help , because there are a number of websites I want to incorporate your awesome script into and would certainly pay for your services to help solve this issue.

They are all Drupal 7 installs with the Omega Framework, so would essentially all have the same issue.

srobbin commented 11 years ago

Unfortunately, I'm not available for that kind of help. Though, there seem to be other Drupal developers in these forums; maybe they've worked their way through these issues, and would be willing to help.

Cheers, Scott

kamescg commented 11 years ago

Totally.

Thanks for your help so far and making this awesome plugin. I am starting to use it on a lot of my websites now.