Issues with HTML marquee not functioning properly post fadeIn()

I am attempting to create a progress bar using the HTML marquee element. When the user clicks submit, I want to fadeIn the HTML marquee and fadeOut with AJAX success. However, when I click the submit button, the marquee does not fadeIn as expected. Here is my attempt:

$(document).ready(function(){
$('#signup-submit').click(function(){
$('.bar').fadeIn();
})

})
.bar{
  background:#a0a0a0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display:none;
}
.progressing{
  width:50px;
  height:4px;
  background:orangered;
  display: block;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<marquee class="bar" scrollamount=50><div class="progressing"></div></marquee>
<input type="button" id="signup-submit" value="signup"/>

However, it works without any jQuery function applied.

.bar{
  background:#a0a0a0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.progress{
  width:50px;
  height:4px;
  background:red;
  display: block;
}
<marquee class="bar" scrollamount=50><div class="progress"></div> </marquee>

What could be causing this issue and how can I resolve it?

Answer №1

It's possible that the issue with the marquee not working is due to using display:none. An alternative approach would be to use opacity:0 and height:0px. Take a look at the snippet below for an example!

Try applying the same method to hide the marquee element.

$(document).ready(function(){
$('#signup-submit').click(function(){
$('.bar').addClass("hide");
})

})
.bar{
  background:#a0a0a0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  opacity:0;
  height:0px;
  transition:opacity 1s ease; 
  overflow:hidden;
}
.bar.hide{
  opacity:1;
  height:auto;
}
.progressing{
  width:50px;
  height:4px;
  background:orangered;
  display: block;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<marquee class="bar" scrollamount=50><div class="progressing"></div></marquee>
<input type="button" id="signup-submit" value="signup"/>

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

Minimize the number of server requests initiated through AJAX technology

I have created a slider component that makes an AJAX request to update a table based on the values selected by the user. When testing this on my local server, I did not notice any issues. However, after deploying the code onto a cloud service, there is si ...

I'm wondering if you have any insights on how to retrieve objects using Mono WebAssembly

I am looking to send a c# object back via mono-wasm, but when I attempt to do so, the returned object appears in my JavaScript file here. The C# code can be found in [image2]: C# code My JavaScript code can be found here: JS code Everything seems to wor ...

An option instead of using a pop-up window

Currently, I have a PHP script and a small form that allows users to upload image files. The user can access this feature by clicking on a button on the parent HTML page, which opens up a Pop Up Window. I understand that not everyone is a fan of 'Pop ...

Storing information upon refresh in Angular 8

When it comes to inter-component communication in my Angular project, I am utilizing BehaviourSubject from RXJS. Currently, I have a setup with 3 components: Inquiry Form Where users enter an ID number to check for summon-related information. This data ...

Is it feasible to utilize a CSS variable within a CSS "background URL" property?

Having trouble setting a base domain for all my pictures in a CSS file. Here's what I've tried: In global.css: :root { --bgd: #C0C0C0; --picdomain: "https://somedomain.com/"; } In s1.css: @import url("global.css"); body { background-co ...

Looking to empty a textbox, give it focus, and avoid triggering an ASP.NET postback all with a single click of a

I am working on an ASP.NET project and I have a simple HTML button. When this button is clicked, my goal is to clear textbox1, set the focus on textbox1, and prevent any postback from occurring. However, I am running into an issue where preventing postba ...

What is the best way to update a form after it has been submitted?

i have a form that looks like this <form id="abc"> <div> <select > <option id= "1"> ha1 </option> <option id= "1"> ha2 </option> <option id= "1"> ha3 </option> <option id= "1"> ha4 </option> ...

Implement a JavaScript confirm dialog for a mailto hyperlink

Is there a way in javascript to automatically detect mailto links on the page and prompt a confirmation dialog when clicked by a user? I came across a method on this website for displaying an alert message. My knowledge of javascript is very basic. It&ap ...

My goal is to have the "show more" button reveal extra information without having to reload the entire page

I’m trying to figure out how to make the “more” button show additional information without reloading the entire page. I’ve done some research online and found that AJAX can help with this, but since I’m just starting to learn JavaScript, I have n ...

Ways to send user input to a function within a React component

I am currently working on implementing a simple feature where users can search posts by their tags. To achieve this, I have created the Feed.jsx component with the following code: "use client"; import { useState, useEffect } from "react&quo ...

Exploring the Usage of sessionStorage within the <template> Tag in Vue.js

Is it possible to access sessionStorage in the script section of a Vuejs component like this? <template> {sessionStorage} </template> Whenever I try to call it this way, I consistently receive the error message "cannot read property &apo ...

What could be the reason why readyState is not equal to 4?

I've been trying to figure out how to use Ajax to fetch data from a database, but I'm encountering some issues... The problem arises when I submit the query and nothing appears on the screen... I understand that this issue is related to the read ...

Troubleshooting MODULE NOT FOUND Error in my First NodeJS Application: A guide to resolving common issues

Welcome to My NodeJS Learning Project! Embarking on my first NodeJS application journey, this project serves as a stepping stone for me to grasp the fundamentals. The goal is to create a basic CRUD web app for item management. Drawing from my experience i ...

Several functions linked to a single prop in Vue

The reference material can be found here: https://v2.vuejs.org/v2/guide/components-custom-events.html#Customizing-Component-v-model seems a bit confusing to me regarding how to link multiple events to the same component: In: https://codesandbox.io/s/da ...

Utilizing JavaScript to implement conditional if-else statements on CSS properties

I am trying to implement conditions on CSS properties in JavaScript. What is the most efficient approach to achieve this? <html> <head> <title>TOOLTIP USING JAVASCRIPT</title> <style> span{ curso ...

Axios.post makes the request twice

Can anyone help me with an issue regarding axios.post where it sends the same request twice with identical data? I have searched online for a solution but haven't found anything. Any ideas on how to resolve this problem? App.js import logo from &apos ...

Material-UI now offers the ability to customize the shadows array within createMuiTheme to support up to 25 different elevations

Currently working on removing shadows in the Material-UI theme. Came across this useful solution that fixed the issue. However, encountered an error related to this topic. const theme = createMuiTheme({ palette: { primary: { light: red[300], ...

Tips for transferring the value of ng-model to multiple controllers

Is it possible to access the value of an ng-model from two different controllers? While I am aware that using a service is one way to share data between controllers, I am struggling to figure out how to pass the value of an ng-model to a service for this ...

Understanding how to translate the content of email confirmation and password reset pages in Parse Server

Is there a way to translate the Email Confirmation and Password Reset pages in my project using Parse server? I have searched everywhere for a solution but haven't found one yet. While I did come across information about email templates, I couldn&apos ...

What is the process for attaching an on-click event listener by utilizing an argument that is passed to a function in JavaScript?

These are the functions I have created: function type(message) { document.getElementById("body").innerHTML="<div id=\"textbox\" class=\"textbox\"></div><div id=\"oc\&q ...