Unable to execute multiple backstretch instances

I am having trouble adding two different backgrounds to two different divs or on the body and a div simultaneously. Only one of the two backgrounds is displayed.

For example, on this page:

The background shows up, but not the #sliders div.

P.S. The JavaScript can be found at the bottom of the code.

Can anyone provide some assistance?

Thank you!

Answer №1

For successful implementation of the Backstretch functionality, make sure to carefully follow the setup instructions provided on the official Backstretch website. In my case, I overlooked the crucial step of initiating the Backstretch script.

It is essential to include the following code within your head tags:

<head>
<script type="text/javascript>

jQuery.backstretch([
      "link-to-image.jpg",
    , "link-to-second-image.jpg",
    , "link-to-third-image.jpg"
  ], {duration: 3000, fade: 750});

</script>
</head>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

including a particular category to a distinct picture

Feeling a bit scattered today and could use some assistance... I've successfully parsed XML into JavaScript, which is running smoothly... Here's a snippet of the XML structure: <test> <part background="images/background.png"> ...

Discovering and substituting a specified text in JQuery

I am facing a particular issue that I need help with. My task involves locating and replacing a specific string obtained through an AJAX request. Code: JQuery: if(!countflag) { $('.panel-body > p').each(function() { var content ...

How to prevent labels from overlapping textboxes when the labels are lengthy using CSS

I am having an issue with an asp control that renders as a text area. I have applied some CSS to style it, but I am facing a problem where a long label is overlapping the textbox. Is there any CSS I can add to push the textbox down if the label gets too lo ...

Animation not functioning properly after Ajax call in event onload

After making an AJAX call to load all the data, I encountered an error in the response data. The code snippet likeObj('#like'+postid).effect("bounce", {times:1,distance:25},400); throws an error stating that likeObj is not a function. I'm s ...

Accessing an HTML DOM element and assigning it to the value of an input tag

One of the elements on my webpage has the unique identifier last_name. I am trying to extract its value and pass it to an input tag. My attempt at achieving this is shown below, but it does not work as intended. <input type="hidden" name="lastName" va ...

What is the best way to have the text in my table cell wrap when it reaches the width of the image in the same cell?

Within the table, I have <td> elements structured like this: <tr> <td> <p class="tableText">Lengthy random text..........</p> <img src="www.imageurl.com/img.png" width="33vw"> </td> &l ...

Tips on transferring multiple elements by dragging and dropping them across various tabs

I am currently experimenting with dragging and dropping multiple elements across different tabs. Check out this JSFiddle. I want to achieve a drag behavior where when one item is being dragged, all other checked items are also dragged along with it, simil ...

How to detect the Back Button or Forward Button events in a single-page application

Currently, I am developing a single-page application that utilizes ASP.NET MVC, Backbone.js, and JQuery. My task involves capturing the browser's back and forward button events for breadcrumb implementation. I previously attempted to use the hashchan ...

Implementing array values into a jQuery graph syntax

After json encoding from php, I have an array that contains information on different categories: [{"Type":"Category","Name":"games","TotalClicks":"162"},{"Type":"Category","Name":"apps","TotalClicks":"29"},{"Type":"Category","Name":"music","TotalClicks":" ...

Out-of-stock contact form button for WooCommerce

Our webshop needs a button added to every out-of-stock product page. I've tried adding the code below, but the button appears on all products, including those that are in stock. Can someone provide guidance on how to fix this issue? Appreciate any he ...

Tips for extending hover duration in CSS

a:hover + #menu { display: block; position: fixed; } My CSS for a hover effect is causing the menu to disappear quickly once I move the mouse away. What steps can I take to fix this issue? Would utilizing JavaScript provide a better solution, and if so, ...

Issue with file upload process in php

I'm currently facing an issue with my file upload function. I've been referring to a website guide for creating the upload form, but made some modifications to it. Here is the code snippet: upload_form.php : //the jquery script is still the sam ...

Passing references between multiple components

I'm currently working on an application using Material-UI in conjunction with styled-components. I am faced with the challenge of passing a ref down to the root <button> node that is created by Material-UI. Material-UI provides a buttonRef prop ...

Is there a way for me to execute a function multiple times in a continuous manner?

I am attempting to create a blinking box by calling a function within itself. The function I have is as follows: $(document).ready(function(){ $("button").click(function(){ $("#div1").fadeToggle("slow"); }); }); <script src="https://a ...

The li elements in a horizontal menu all have equal spacing between them, filling the width of the ul

I designed a horizontal menu navigation system using HTML elements ul for the main menu container and li for menu list items. The layout is structured with display table for ul and table-cell for li. However, I encountered an issue where there are inconsis ...

Preventing image rotation in an Angular 4 application: Strategies and Solutions

My Angular application allows users to choose a profile picture. During testing, I discovered that when I upload images from an iPhone in portrait mode, they appear rotated in my app. However, when the photos are taken in landscape mode, they display corre ...

Revising table content utilizing Django and Ajax

I am currently working with a pandas dataframe that I need to display in a Django Template. This is how I am doing it: In my views.py file def display(request): if request.method == 'POST': temp_df_path = './temp_match.csv&apos ...

Polyfill for the :nth-column CSS4 Grid-Structural pseudo-class

In my CSS grid layout, I want to include a margin in every even column. While the :nth-column pseudo-class would be ideal for this, it unfortunately won't be supported in the near future. Could anyone recommend any polyfills that I could utilize, or ...

The alignment of a background image in CSS is different from using margin:0 auto, especially when dealing with scrollbars

Check out the following link to view the issue: http://jsfiddle.net/7zb6P/1/ In a scrolling div, both the yellow box and the background image are centered, however their centers appear slightly different. The discrepancy seems to be because the background ...

What could be causing the CSRF Token mismatch error to occur solely on the initial page load following my login within my Laravel 8 application?

One issue I'm encountering is with a form that relies on an AJAX call to load values into certain fields once the first input is filled. In my blade file, I have included the CSRF token as an input using "@csrf". However, when making the AJAX call, I ...