Hello,

I am very new to Drupal (7.x), having switched over from Joomla because of Drupal's native use of jQuery, so thank you in advance for helping out. I have read Drupal's guide for posting issues and hope that I have followed it as much as possible. I have created a custom theme from scratch using this excellent guide.

Following the instructions given in drupal.org/projects/backstretch, I installed the Libraries 7.x-2.x-dev module in sites/all/modules, enabled it in Administration > Modules, then I chose "Install New Module" from the overlay, and installed Backstretch from http://ftp.drupal.org/files/projects/backstretch-7.x-1.x-dev.zip. Installing Backstretch this way has properly created a backstretch folder in sites/all/modules alongside libraries. This appeared to be successful, as Backstretch is now listed in my list of modules and when I go to Administration > Appearance I have a tab entitled "Backstretch" wherein I can specify a path to my image.

My problem is this: no matter what path I put in, the image does not show up. I have even put in an absolute path to the image, but it is still not showing up. I have cleared the cache, and still nothing. When I inspect the page in Firebug, I do not see a Backstretch script being loaded, and the only CSS targeting the background of the <body> element is a color that I have specified in my style.css file.

An important note on the Backstretch project page says that "You might have to alter the css of your site's container divs to set the background to transparent to allow the image to show through." I'm not sure what this means in terms of a CSS rule, but as far as I can tell there is nothing in any of my containing <div>s overriding the cascade. The #wrapper only extends to 80% width, so even if the image is being loaded underneath #wrapper for some reason, I should still be able to see evidence of it.

I have included my theme files as a *.zip attachment. The image I am trying to call in Backstretch is images/verso.png. I am running Drupal 7.x on XAMPP, Drupal root is in htdocs/drupal. Any help would be very, very appreciated!! Thanks!!

CommentFileSizeAuthor
OOZ_theme.zip502.74 KBdiekunstderfuge

Comments

alfredojr’s picture

Maybe you did this but I didn't see it in your message. You should download the Jquery plugin "https://nodeload.github.com/srobbin/jquery-backstretch/zipball/1.2.5" and place it into a folder named "backstretch" in your libraries folder.

ultimateboy’s picture

Status: Active » Closed (cannot reproduce)

alfredojr is most likely correct. You can check your source and verify that a div with an id of #backstretch is being added to the footer. If the div is there, and you are still not seeing the image, then its most likely the css of your theme that is covering things up.. if the div is not there, then I guess that you have not correctly added the backstretch library.

cossimo’s picture

Category: bug » support
Status: Closed (cannot reproduce) » Active

Would you mind posting the exact path to the library? I have installed the library such that all the components and subdirectories of the library reside at /sites/all/libraries/backstretch. (E.g., the minified version of the library is at /sites/all/libraries/backstretch/jquery.backstretch.min.js.).

However, after enabling the module and assigning a path to a background file, the #backstretch div still does not show up anywhere on the page.

Any help would be greatly appreciated.

Thanks,

C.

cossimo’s picture

Changing status to active for now.

thermalmusic’s picture

I am having the same issue. Everything is installed correctly, backstretch module, library files, paths etc. But there is no instance of #backstretch or jquery.backstretch.min.js file in the page source.

thermalmusic’s picture

The Backstretch module is not working with the latest jquery.backstretch.js 2.0.2, which has more features. I tested by switching to v1.2.5 and it works with that one. Can you please update the module to be compatible with v2.0.2? It would be very helpful.

Thanks

ultimateboy’s picture

Title: Backstretch installed but not displaying image » Backstretch module not compatible with latest backstretch library 2.0.2
Component: User interface » Code
Assigned: Unassigned » ultimateboy
Category: support » bug

Ah ha! Thanks for the info. I'll work on getting this fixed.

ultimateboy’s picture

Status: Active » Needs review

I just pushed out some code which should resolve the issues when using the current jquery.backstretch version (2.0.2). The -dev build should be re-built sometime soon, but feel free to try things out by checking the module out from git.

Basically, there were two changes in the latest jquery.backstretch which broke this, the first where/how the version string appears in the jquery.backstretch.js, they switched from "Version 1.2.5" to "v2.0.2". The second change is that $.backstretch() now accepts an array for additional "slideshow" support. I'll work on integrating some of the new functionality in to the module at a later time, but for now, at least it works :D

Commit: http://drupalcode.org/project/backstretch.git/commit/refs/heads/7.x-1.x

asauterChicago’s picture

@ultimateboy

This update seems to actually call in the code in now to the page (where before I could do a Control + F "backstretch" and nothing would come up in page source). It's calling in:

/sites/all/modules/backstretch/backstretch.css
/sites/all/libraries/backstretch/jquery.backstretch.js
and in the footer:
/sites/all/modules/backstretch/bs.js

For testing purposes I pulled an image from Reddit (/r/windowshots), just to make sure it wasn't my paths that were bad. I can see it is pulling, what looks like to me at least, the correct code into the page when I look at the page source:

"backstretchURL":"http:\/\/i.imgur.com\/j0SiM.jpg","backstretchMinWidth":"600px",

But no image seems to display... I cleared my browser caches and tested on Chrome, Safari and Firefox, nothing. It seems to be all there, but doesn't pull up anything... Any ideas?

I would give you a link but this is all on my computer (using Mamp). I can make a it live somwhere as a testing environment if you need me to, but just wanted to check and see if you had any ideas first.

thermalmusic’s picture

Thanks for your updated code - it now works with v2.0.2, which is great. But I'm really interested in having the slideshow functionality. Can you offer any ideas or code on passing an array of images from the module to the library in the meantime? I hope you will update this module soon!

Best,
T.

eltioseba’s picture

Hi, I´m using the latest module release with backstretch 2.0.3

The background image actually loads, and fits the browser size, but it don't resize dynamically like it should.
So if a reload a page the background fits the screen but if I then maximize the image maintain the previous size. I used this module, and backstretch, before without any problem.

Any advise to solve this?
thanks for your efforts

eltioseba’s picture

A bit more info about the error from Firebug pointing to jquery.backstretch.js:

TypeError: $(...).on is not a function	

$(window).on('resize.backstretch', $.proxy(this.resize, this))
andy.smith’s picture

I am having the same issue as eltioseba after a recent update of both the module and Backstretch library. The image loads but does not resize.

I also am having issues with the scroller not working anymore either...

dereckd’s picture

I am also having the same issue, the image does not resize

alexverb’s picture

I'm shure most of you are having trouble with matching backstretch library with the right version of jQuery. You should try using the jquery_update 7.x-2.x-dev version and on /admin/config/development/jquery_update select version 1.7. That should solve your problems.

If it's still not working I would check if the library is loading properly and do a dpm() of libraries_load('backstretch')). If ['loaded'] returns FALSE you have probably not extracted and/or renamed your library folder correctly.

eltioseba’s picture

Thanks for the explanation!
Now is working as expected.

Maybe it should be documented (or I miss it?).

alexverb’s picture

It is a well known fact that Drupal provides a version of jQuery that is not always compatible with external libraries. So I would always recommend to read the plugin's documentation:

https://github.com/srobbin/jquery-backstretch#setup

dereckd’s picture

For some reason I found that I had to use the dev version of JQuery Update, the production version was not letting me select jQuiry 7 as an option.

yannickoo’s picture

Status: Needs review » Fixed

That is true, you have to install jQuery Update 2.x so that you can choose jQuery 1.7. In the new Backstretch 2.x version you will get a notification if jQuery 1.7 is not available.

yannickoo’s picture

Assigned: ultimateboy » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.