When CSS animations are active, the jQuery hide().slideDown() function fails to execute properly

I am a beginner in this field.

Initially, I used jQuery to create three divs (buttons) that slid down when the page loaded. I also added an expansion effect on mouseover. This method worked fine in Safari but not in Firefox. So I made some modifications.

Now, I have implemented CSS animations for the hover effect and used a jQuery function to make the buttons slide down on load. However, there seems to be an issue with the slideDown functionality.

Here is the HTML code:

<div class="header">
    <div class="button_container">
        <a href = "../index.htm"><div class="header_button home_button">Back to Home</div></a>
        <a href = "../Projects/projects.htm"><div class="header_button projects_button">Projects</div></a>
        <a href = "../Resume/resume.htm"><div class="header_button resume_button" >Resume</div></a>
    </div>
</div>

This is the CSS code:

.header_button {
    display: inline-block;
    height: 130px;
    line-height: 130px;
    width: 300px;
    background-color: lightgrey;
    color: black;
    box-shadow: 0 0 10px;
    -moz-transition: 0.5s all ease-in-out;
    -ms-transition: 0.5s all ease-in-out;
    -webkit-transition: 0.5s all ease-in-out;
    -o-transition: 0.5s all ease-in-out;
}

.header_button:hover {
    background-color: lightyellow;
    height: 140px;
    -moz-transition: 0.5s all ease-in-out;
    -ms-transition: 0.5s all ease-in-out;
    -webkit-transition: 0.5s all ease-in-out;
    -o-transition: 0.5s all ease-in-out;
}

I gathered information from various sources, including Stack Overflow, to achieve the desired hover-expand effect.

And here is the jQuery code:

$(document).ready(function() {
    $('.header_button').hide().slideDown('slow');
});

Check out the convenient jsFiddle link here.

Answer №1

New Update in Fiddle

Take a look at this snippet,

$(document).ready(function() {
    $('.nav_links').closest('ul').hide().fadeIn('slow');
});

Even if you hide .nav_links, its closest parent element <ul> will still be visible.

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

Guide on adding pictures to an ExpressJS server

Working on this project has been quite a challenge for me as I delve deeper into web development. As a relatively new developer, creating a one-page application with image upload functionality has proven to be quite the task, especially considering this is ...

What is the reason that CSS selectors cannot use numbers as IDs?

I have come to realize that numbers cannot be used in CSS selectors. <!DOCTYPE html> <html> <style type="text/css"> div{width:350px;word-wrap:break-all; } #1{float:left;} </style> <div class="up"> <p><img id= ...

How can I retrieve items from an object that are contained within a nested array with a specific value

I am working with a nested array of objects, and I am trying to extract matching items based on a specific value stored in the nested object within these objects, which also contain nested arrays. Example: Sample data: const items = [ { name: & ...

Assistance with CSS: How to Remove a Shape

Is it possible to remove the triangles above the element labels using CSS? To view them, click on a link (hear, see, savor). There is a dotted line and text with a small red triangle/arrow that is not centered. I have managed to disable them for the menus, ...

Add an element to an array and check if it is already present

Hey everyone! I've written some code and need help fixing it so that the if statement works properly when adding the same student. Thanks so much for any assistance! class Student { constructor(name, email, community) { this.name = name; this ...

An error in typescript involving a "const" assertion and a string array

Currently, I am diving into the world of Typescript along with React. However, an error has emerged in my path that I can't seem to figure out. It's puzzling why this issue is occurring in the first place. Allow me to elaborate below. const color ...

Error alert: $.simpleWeather function not found

Currently, I am attempting to incorporate simpleWeather.js from the website simpleweatherjs.com into my own website. However, upon inserting the html code onto my website, an error message pops up: Uncaught TypeError: $.simpleWeather is not a function ...

Transform the array by utilizing its own elements

I came up with a solution to a problem I was facing, but I'm not entirely comfortable with it. It feels risky to me, like using an array to redefine itself is not a good coding practice. It's similar to trying to explain a word by using the word ...

Error message indicates failure of switch case, resulting in invalid output of

My BMI calculator was working fine until I switched the conditionals to a switch statement for cleaner code. Now, the code is breaking and the result variable isn't being set properly for display. Do you have any ideas on what could be missing here? ...

JSON parsing throws an error due to encountering an 'unexpected end of input' issue

Here's some code I'm working with: var default_links = '{ "name" : "Google", "url": "https://encrypted.google.com/", "fav_url": "https://encrypted.google.com/favicon.ico" }\n'+ '{ "name" : "Yahoo", "url": "http://www. ...

Switching from React version 15.6.2 to 16 results in disruptions to the functionality of the web

Currently, I am encountering an issue where none of my index.js files are rendering. After using the react-scripts to build my web application in version 16.2.0, I receive an error stating that r.PropTypes is undefined when trying to access the localhost a ...

Retrieve the checkbox value and assign it to an object in the $scope of an Angular

As a newcomer to angularjs, I've been struggling with this code snippet for the past two days. My goal is to retrieve values from selected checkboxes within my angular js controller. I have experimented with both ng-true-value and ng-false-value, bu ...

Customize div styles according to the website domain

I want to dynamically change the header of my website based on whether it is in dev QA or production environment. Below is the HTML code: <div id="wrapper"> <form id="form1" runat="server"> <div class="wrapper"> <div> ...

Wordpress woes: When Ajax fails to yield a successful result

I am facing an issue where I am trying to retrieve a return value from an AJAX call when the database gets updated. The data is being sent through AJAX to a function located in functions.php within one of the Wordpress plugins' folders. However, whene ...

SoundCloud authentication failed because the sign-in callback is attempting to access a frame from a different origin

Latest SoundCloud SDK Version About a year ago, I successfully registered my App. To my surprise, today I found that the SoundCloud (SC) sign-in feature is no longer working. Upon clicking the button, a SC pop-up window appears with the message "Allow ...

Creating Low-Poly Terrain with a Touch of Serendipity

Looking to create terrain in a low-poly style inspired by the landscapes in Cube Slam and this video. I experimented with the webgl_geometry_terrain.html example, but it's still generating smooth terrain instead of the flat polygons I'm aiming fo ...

What is the method for displaying the value of a textarea?

I am relatively new to the world of coding, but I have already delved into HTML, CSS, and basic DOM scripting. My goal is simple - I want to create a comment box where people can leave messages like in a guestbook. However, when I input text and click on ...

Issues with jQuery autocomplete when using special characters (Norwegian)

On my website in Norway, I am facing an issue with jQuery's autocomplete function. When users type in the Norwegian characters æ, ø, and å, the autocomplete feature suggests words with these characters within them but not ones that start with these ...

What is the best way to allocate a larger size to one part of a flex div?

A div is used to insert information <div class="inputs"> <div class="content">@Html.TextBoxFor(model => invoices.ProductDesc, new { disabled = "disabled", @readonly = "readonly" })</div> <div class="content">@Html.TextBo ...

Using Rails to render various js templates based on different AJAX requests

My Rails app includes a Movies#index page where I send AJAX requests in two scenarios: When I am loading more @movies When I am filtering @movies I am looking for a way to render different js files based on which scenario I am handling, instead of using ...