Is smoothstate.js incompatible with varying background images?

Currently, I am in the process of enhancing the transition from my intro page to my home page. You can view the current setup at . I have implemented smoothstate.js for this purpose, but I am facing issues with achieving a seamless transition between pages. My suspicion is that the use of images as background may be causing the problem, as it deviates from the typical demos. To validate this assumption, I am seeking assistance here. Could Bootstrap be playing a role in this?

I have shared the code snippet below. Additionally, I experimented with reveal.js, although its functionality differs slightly from what I'm aiming for – incorporating smooth transitions.

Your guidance and support are highly valued.

$(function(){
  'use strict';
  var $page = $('#main'),
      options = {
        debug: true,
        prefetch: true,
        cacheLength: 2,
        onStart: {
          duration: 250, // Duration of our animation
          render: function ($container) {
            // Add your CSS animation reversing class
            $container.addClass('is-exiting');
            // Restart your animation
            smoothState.restartCSSAnimations();
          }
        },
        onReady: {
          duration: 0,
          render: function ($container, $newContent) {
            // Remove your CSS animation reversing class
            $container.removeClass('is-exiting');
            // Inject the new content
            $container.html($newContent);
          }
        }
      },
      smoothState = $page.smoothState(options).data('smoothState');
});
.intro {
  background: url(img/headerbg.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  width: 100%;
  height: 100vh;
}
.site-wrapper {
  display: table;
  width: 100%;
  height: 100%; /* For at least Firefox */
  min-height: 100%;
  -webkit-box-shadow: inset 0 0 100px rgba(0,0,0,.5);
          box-shadow: inset 0 0 100px rgba(0,0,0,.5);
}
.site-wrapper-inner {
  display: table-cell;
  vertical-align: middle;
}
.cover-container {
  margin-right: auto;
  margin-left: auto;
}

.inner {
  padding: 30px;
}

.cover {
  padding: 0 20px;
}
    <div id="main" class="m-scene">
      <div class="scene_element scene_element--fadeinright">
        <div class="intro">
          <div class="site-wrapper">

            <div class="site-wrapper-inner">
              <div class="cover-container">
                <div class="inner cover">
                  <a class="center-block" href="newhome.html" data-transition="fade"><img class="img-responsive" src="img/Bang_logo.png"></a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

Answer №1

Your CSS doesn't appear to have any animations defined. Therefore, the classes m-scene, scene_element, scene_element--fadeinright, and is-exiting are not having any effect.

However, it seems that smoothState.js is functioning properly by replacing content via ajax and applying the is-exiting class as intended.

Answer №2

It seems like there is a problem with the CSS animations on your site, and sometimes I encounter a 404 error for jquery.smoothState.js.

Despite this issue, I don't think Bootstrap is causing it. I have successfully used Bootstrap for creating transitions and incorporating background images on my website.

If you're interested, feel free to review the code on my site:

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

Aligning Slide Elements with Reusable and Isolated Styles in Marp

Is there a way to centrally align slide content in Marp without duplication? I managed to achieve this with the following code snippet, but I had to manually paste it on each slide: --- <style scoped> section { display: flex; flex-direction: co ...

What are your methods for testing HTML content on mobile devices?

I prefer using the Brackets editor for development. I can easily check my website on Chrome in desktop mode by entering this URL: http://127.0.0.1:49371/index.html However, I'm having trouble loading it on my iPhone (even though we're using the ...

Creating a submit button in PHP and JavaScript

I am facing an issue with developing a submit button using JavaScript. On my webpage, I have both a registration and a login form placed together. The problem arises when I click on the login button - instead of accessing the login details, it redirects to ...

Is an HTML special character available for a down-right arrow symbol?

One of the features on my website is posting audio files, and some of them are accompanied by videos. I am trying to organize it in this manner: AUDIO FILE: | --> VIDEO FILE I am aware that &crarr; creates a carriage return (↵), but I am ...

Transferring the value stored in the value attribute to a different PHP page?

I am attempting to pass the value from the value attribute in button using a form with the method POST to "landlord_home.php". However, when I click on the button to navigate to the next page "edit_post.php", it triggers the PHP validation code on that pag ...

Enhancing the appearance of a select element on Firefox

Trying to customize a <select> element in Firefox. I successfully styled it in Chrome using the following CSS: -webkit-appearance: none; background: #eeeeee url("../img/select-arrow.jpg") no-repeat center right; However, I'm facing difficultie ...

Pythonanywhere is throwing a NOREVERSEMATCH error when accessing /blog, whereas the localhost is functioning flawlessly

PythonAnywhere is encountering an issue with NOREVERSEMATCH at the /blog location, but it functions perfectly fine on localhost. I have taken the steps to resave the project, committed it to GitHub again, and pulled it on PythonAnywhere. Despite these eff ...

I'm currently developing a Javascript quiz, but unfortunately, I am not seeing any outcomes. Can someone identify the issues in my code and provide guidance on what steps I should take next?

There are 3 requirements I must meet: The script should show the number of correct answers and the percentage of correctness at the end of the quiz. If all questions are answered correctly, display 'Well Done', or else display 'Try again&ap ...

Creating an inline css style for a different class within a div - tips and tricks

In my code, I have two separate div blocks. The first div has a class name of divone, while the second div has a class name of divtwo. I am able to write inline styles for the divone block, but now I want to apply inline styles directly to the divtwo block ...

Which is better: cssText or a unique stylename for individual elements

When making numerous style changes to a single element using JavaScript, phpied and Writing Efficient JavaScript suggest: instead of applying styles one by one using style.stylename, apply everything in one go using cssText or changing classname as it&a ...

Updates made to the Transform property in Mui Theme are not appearing in the browser

I'm looking to modify the MuiInputLabel.outlined. While I can see various changes when inspecting in the browser, I'm having trouble seeing the transform property change specifically. This is the current configuration of my MuiInputLabel: MuiInp ...

Easily ajaxify your website without the need for hash or hashbang URLs

Currently enrolled in a web design course, I am eager to explore the world of ajax and how it can enhance our projects. Unfortunately, our instructor focuses solely on design and HTML, leaving us to figure out the more technical aspects on our own. If I m ...

Unable to see Primereact styles reflected on components

After some investigation, I've pinpointed the issue to be related to preflight from tailwind. Upon reviewing the documentation, I came across this helpful information: CSS Layer It seems that using Tailwind CSS with styled or unstyled modes of PrimeR ...

What is the best way to save geolocation coordinates in a Javascript array?

I am attempting to utilize HTML5 geolocation to determine a user's location and then store the latitude and longitude coordinates in an array for future use with Google Maps and SQL statements. However, when I attempt to add these coordinates to the a ...

Verifying if checkboxes are selected in PHP using JavaScript

echo '<div class="col-lg-10 col-lg-offset-1 panel">' . "<table id='data' class='table'> <tr> <th></th> <th>Document No</th> <th>AWB NO</th> ...

Utilizing CSS3 Columns to control the flow of elements and enforce breaks

Struggling to articulate my question, but I'll give it a shot :D Let's talk about the images: I'm having trouble explaining, I want to align the elements like in the first image, but all I'm getting is the second and third pictures. C ...

Using the v-for loop to generate radio inputs results in selecting multiple radio buttons with identical values

Having a bit of trouble explaining, I've developed a basic rating system that utilizes input type ="radio" for an array of products. By using v-for="product in products", I iterate through the array and display all the products on the webpage. ...

Emphasize a portion of a text / Apply formatting to a variable

I am facing an issue where I need to format only the date in a specific string. I have managed to extract the date and store it in a variable after isolating it from the original message. <div class="foo"><p> Click here now and get by January ...

What is the best way to create a fixed sidebar or top bar that remains visible as I move to different pages?

Whenever I navigate to other pages, the sidebar mysteriously disappears. As I work on my project about an admin page, I'm wondering if it's necessary to include every single page? ...

Is it possible to convert mirrored gradients into CSS code?

Is it possible to transform this "reflected" gradient image into CSS code? And if so, how would I go about doing that? ...