Image vanishes abruptly instead of fading out

Hello everyone, I'm currently working on a CSS3 fullscreen slider. The issue I'm facing is that whenever I apply an image fadeOut effect, it suddenly disappears as if the hide() method has been triggered. Here's the code: CSS:

   body {
        margin: 0px;
    }

    #backgroundImageContainer {
        height: 100%;
        width: 100%;
        position: fixed;
    }
    .backgroundImages {
        width: 100%;
        height: 100%;
        position: absolute;
        z-index: 1; 
    }
    .animationZoomIN {

        -webkit-transition: all 5.3s ease-out;
        -moz-transition: all 5.3s ease-out;
        -o-transition: all 5.3s ease-out;
        transition: all 5.3s ease-out;
        -moz-transform: scale(1.17);
        -webkit-transform: scale(1.17);
        -o-transform: scale(1.17);
        transform: scale(1.17);
        -ms-transform: scale(1.17);
    }
    #thumbsList {
        position: absolute;
        z-index: 2;
        margin-top: 11px;
        margin-right: 11px;
        color: white;
        font-family: verdana;
        font-size: 13px;
        list-style-type: none;
    }
    #thumbsList li {
        float: left;
    }

JavaScript:

   $(document).ready(function() {

        $('.backgroundImages').addClass('animationZoomIN');
        $('.backgroundImages').bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function () {


            $('.backgroundImages').fadeOut(1000);});
    });

HTML:

   <div id="backgroundImageContainer">
    <img class="backgroundImages" src="wallpaper-452100.png" />

</div>
<ul id="thumbsList">
    <li>Steam Punk</li>
    <li>Car</li>

</ul>

I noticed that the .backgroundImages fadeOut method is not functioning correctly, causing the image to disappear suddenly. Can anyone point out my mistake? Thank you.

Here's the Fiddle link: http://jsfiddle.net/4xymL/

The image may not be displaying properly, so please try using a sample image. Thank you for your help!

Answer №1

To achieve a smooth transition, adjust the opacity using this demonstration and then proceed to fade out after a 5-second delay (depending on the zoom specified in the CSS).

 $(document).ready(function () {

     $('.backgroundImages').addClass('animationZoomIN');
     $('.backgroundImages').bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function () {


         $('.backgroundImages').css("opacity", 0).delay(5000).fadeOut();
     });
 });

An update has been made to include fading out, as simply adjusting the opacity will not completely remove the image, allowing it to still be visible by right-clicking.

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

Having trouble with the page background image link not functioning properly because of the wrapper

I am facing an issue with my HTML layout. I have a full background image set within the body tag, followed by a wrapper element: <body> <a href="#" id="bkimage">Background Image</a> <wrapper> ................. Here are the styles ...

Create a randomly generated value in a JSON format

{ "description": "AppName", "name": "appName", "partnerProfile": { "email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f19090b1969c90989ddf929e9c">[email protected]</a>", "firstName": "John", ...

Unable to change the visibility of blockquotes using jquery

Currently, I am delving into the world of basic JQuery functions. My main focus right now is figuring out how to display the active blockquote while keeping the others closed or closing them. Essentially, creating a toggle effect where only one blockquote ...

jquery plugin for creating Excel-like filters

I am in the process of creating Excel-like filtering for my dynamic table. To achieve this, I am utilizing a jQuery plugin that can be found at https://github.com/chestercharles/excel-bootstrap-table-filter. The reason why I chose this plugin is because it ...

Facing issues with displaying CSS and images on Django website

Just starting out with Django and encountering some trouble getting my CSS and images to display in my home.html file. I attempted to add a STATICFILES_DIR based on some research I did, but the content still isn't showing up. I also experimented with ...

Despite utilizing overflow and wrap properties, HTML lists still fail to display horizontally

Make sure to copy the code and run the HTML file first. For organization, place the JavaScript file in the scripts folder and the CSS file in the styles folder. The issue at hand is that the li elements are not displaying horizontally as intended; they n ...

Tips on preventing the opening of a new browser tab by using Ctrl + click

Hey there, I've got a list of products that can be selected using the Ctrl key. $(parentSelector).on("click", function (evnt) { evnt.stopImmediatePropagation(); var item = $(evnt.delegateTarget) ...

How to exclude the initial iteration in a v-for loop in VueJS2?

I am currently working on a project using Laravel 5.5, Vue.js 2, and Lodash. I am trying to skip the first incoming data in the result, similar to the image shown below. Below is the code for my Vue.js 2 implementation: new Vue({ el:'#users', d ...

What is the reason the text does not have a border around it?

The border is supposed to be around the text, but it isn't showing up. Where did I go wrong? Could it be that I need to set a position? html { width: 100%; height: 100%; margin: 0; padding: 0; } body { width: 100%; height: 100%; marg ...

Align Text with Icon Using FontAwesome

Hey, I'm having a bit of trouble with something simple and it's driving me crazy. All I want to do is center the text vertically next to a FontAwesome icon. However, no matter what I try, I just can't seem to get it to work. I've looke ...

Bottom is not adhering properly to the page (blocking content)

Hey there! I'm using Weebly as a CMS for my website, and I've encountered some issues with a custom footer. Specifically, on this page: The content seems to disappear if you're not using a large monitor and the page height is short. Upon in ...

Encode a MySQL query using json_encode to generate data for a multi-series flot chart

I'm attempting to convert a MySQL query into the specified JSON format for a flot chart, as outlined in the documentation: [ { label: "Foo", data: [ [10, 1], [17, -14], [30, 5] ] }, { label: "Bar", data: [ [11, 13], [19, 11], [30, -7] ] } ] Here i ...

Dealing with jQuery's scrollTop viewport problem: Adding a personalized value to position().top

I'm currently working on a single-page WordPress site. Since it's all contained on one page, I've implemented jQuery scrollTop to animate the menu when clicked. However, I am facing an issue where the fixed menu is overlapping the content of ...

The issue with jQuery Ajax Basic Authentication Header persistence and functionality

I am struggling with sending a basic GET request to a server using JQuery. $.ajax({ headers: { "Authorization": "Basic " + btoa("hello" + ":" + "world") }, url: "http://hello.world?Id=1", method: "GET", ...

Stand out with Bootstrap's wide card design

Does anyone know how I can correct the image display issue within this card using Bootstrap 4? I am attempting to adjust the picture so that it is perfectly scaled to fit within a fixed height card. Currently, the image appears stretched and I am explorin ...

What are some successful methods for displaying extensive data lists to users in a meaningful and organized manner?

From dropdown lists to hover menus with fly-out options, there are various ways to present content on a website... I am managing a comprehensive list of U.S. military bases across the world for my website. This list includes both active and inactive bases ...

prevent access to a specific webpage if a specific div element is visible

I have integrated a countdown timer plugin into my WordPress website and now I am looking to restrict access to a specific URL until the timer has reached zero. Currently, I am able to determine when the countdown timer is complete by checking for a certa ...

It is not possible to modify the CSS styles within the PrimeFaces Ultima template

Within my JSF project, I am utilizing the ultima template's latest version (ver. 2.0.2). Following the recent update of the project, there seems to have been a change in the CSS due to the presence of this selector: * { -moz-box-sizing: border-box ...

Achieve a seamless integration of a navbar and list on the same line by utilizing the power of Bootstrap

No matter how much I tried, I couldn't solve the problem of my list not appearing in the same line. I attempted using display: inline-block; and padding: 0, but to no avail. /* added by editor for demonstration purpose */ body { background-color: ...

Pass information back from C# to jQuery UI autocomplete

I'm looking to populate my autocomplete feature with database data, so I created a C# method to retrieve it: public string[] GetNames() { var names = unitOfWork.deviceRepository.Get().Select(w=>w.Name); return names.ToArray(); } This meth ...