New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backstretch can now be applied to multiple DIVs #93
Conversation
This commit includes additional options and the ability to apply the backstretch to multiple DIV containers, instead of only the BODY of a page.
This is awesome! Thanks, Tim. I'm going to be adding in a couple more features for the next release, so it might be a week or so before I pull in the changes. Still, I really appreciate this pull. Thanks so much. |
Here is an example of some of the new usage:
|
Love the plugin, thanks for sharing your work guys. It'd be really awesome if this pull request was added! |
This is an awesome update to the plugin! Used this source over the original... |
Hi, |
|
thanks Tim! |
Hey, I have a single page in 3 Main Div (page1 - page3) is this right? <script> $.backstretch("bg1.jpg", {speed: 500}); QueryLoader.init(); $.backstretch("bg2.jpg", { 'target': '#page-2', 'speed': 500, 'positionType': 'absolute', 'zIndex': 0 }); </script>Hope you can help me ;) |
Hi, I'm wondering about the same thing as 'johntuesday. $.backstretch('img/bg/home.jpg', { and the width that is setting is longer than the container... |
I'm pretty sure that the issue everyone is experiencing has to do with the This is in the HTML above $.backstretch('images/image1.jpg', {
'target': '#one',
'speed': 1000,
'positionType': 'relative',
});
$.backstretch('images/image2.jpg', {
'target': '#two',
'speed': 1000,
'positionType': 'relative',
});
$.backstretch('images/image3.jpg', {
'target': '#three',
'speed': 1000,
'positionType': 'relative',
}); Also, a tip/issue when using backstretch on vertical divs is in regards to responsive design. I adjusted the heights of the divs at specific breaks so that it flowed nicer. I suppose you could include some JS that resizes the height dynamically, but that's another story... Here's an example with an (abridged) media query I'm using: .section {
width: auto;
height: 825px;
margin: 0px auto -20px auto;
overflow: hidden;
}
.
.
.
@media screen and (max-width:500px) {
.section {
height: 540px;
}
} |
@paulmolluzzo - thanks for your reply mate. Basically I have my 3 DIV's aligned vertically on the page ( I'm setting the width & height via css, not JS ) and the backstretch images are being rendered, but only the last one in the chain goes 100% width & height, the other 2 ( so the first 2 ) only showing the image at its original dimensions. Did you run into the same issue? |
Hmm...this is frustrating. I can get it to work in the usual way; $.backstretch("pot-holder.jpg"); and the div way when using HTML element tags; $.backstretch("baseurl ;?>/templates/template ;?>/images/text-bg.jpg", { and $.backstretch("baseurl ;?>/templates/template ;?>/images/text-bg.jpg", { $.backstretch("baseurl ;?>/templates/template ;?>/images/text-bg.jpg", { Which all append the div appropriately. However, the following: $.backstretch("baseurl ;?>/templates/template ;?>/images/text-bg.jpg", { Doesn't do anything at all. Theres no prepended divs there in the source code at all. Have tried with and without the "#" before the div name, different divs, and even div.myDiv etc... |
Wow Man! I'm kind of in love with you... Thanks a million! |
I'm having the same problem as @Sebah I have a vertical, two DIV layout. Both DIV's have the following CSS: The two DIV ID's are "#img1" and "#img2" The code I run is what @paulmolluzzo posted above:
While img2.jpg gets stretched, img1 remains unstretched. It doesn't matter if I change the order in the script, it's always the last one that gets affected by the stretch. I've tested this in both FF 14 and IE 8 - same problem. The code I have taken from GitHub so it should be the latest version I guess. The jQuery library I'm using is http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js if that would matter? It's really frustrating since I love what it does.. or would do if it worked =) |
Hi Everyone, I've got a new version of Backstretch in progress that adds this functionality, and makes it easier to do slideshows. Would you mind taking a look, giving it a spin, and letting me know if you have any troubles or thoughts? Thank you, again, to @timnovinger for submitting his excellent patch, and for inspiring this thread. I chose to refactor much of the plugin, so his changes couldn't be merged, though they were very helpful in guiding the implementation. https://github.com/srobbin/jquery-backstretch/tree/2.0.0-wip |
Hi having a problem with no images loading for the past 5 days of trying with backstretch. Checked all my file paths, have proper library plugins, checking order of markup, checked order of scripts. Any ideas? please help! Here is my code:
I don't have any css declared, FYI. Thanks so much! |
@ christopherkoelsch |
Yes -- thanks so much for replying. Nothing appears but here is the link: http://christopherkoelsch.com/new_website/test.html Huge thanks again. On Wed, Nov 6, 2013 at 1:40 PM, eladnova notifications@github.com wrote:
|
@christopherkoelsch change the following lines: <link rel="stylesheet" href="new_website/new_site_css/stylesheet2.css" type="text/css" media="screen" title="CSS" charset="utf-8" />
<script type="text/javascript" src="new_website/jquery.backstretch.js"></script> to <link rel="stylesheet" href="./new_site_css/stylesheet2.css" type="text/css" media="screen" title="CSS" charset="utf-8" />
<script type="text/javascript" src="./jquery.backstretch.js"></script> or prefix the "new_website" part with a "/" to make it an absolute URL: "/new_website/jquery.backstretch.js" |
Hey Kevin: Thanks so much for answering my question! Changed to the above code -- and it still doesn't work for some reason. Any more ideas? Many thanks Chris On Wed, Nov 6, 2013 at 4:56 PM, Kevin Crawford notifications@github.comwrote:
|
Chris - I can't see where you are telling backstretch which block level element you want the image applied to? Then again, I normally apply it to a DIV so that might not be the issue. Why dont you try applying it to a DIV for the moment and we might be able to narrow it down? |
Chris - I downloaded your page and files and got it working on your body tag. Next up is your paths issue. If you want, I can forward you a zipped up folder of my working demo. |
The zip would be great. So appreciated! Many thanks. I'll check out the C. On Thu, Nov 7, 2013 at 6:24 AM, eladnova notifications@github.com wrote:
|
This adds the ability to apply the backstretch to multiple DIV containers, instead of only the Body of a page, along with additional CSS options to go with it.