One specific image of mine remains unchanged by the opacity setting in CSS

One of my arrows (id="darrow") is not responding to the opacity: 0.7 property in my CSS, while the other arrow works perfectly fine. Can anyone help me figure out what's going wrong? It was working fine until I added a second arrow and an animation.

HTML:

<img src="images/stills/uarrow.png" id="uarrow">
<img src="images/stills/darrow.png" id="darrow"> <!--Troublesome arrow-->
<div id="footer">
<p id="fpara">Site/logo design by Zachary Ledyard.</p>
</div>

CSS:

#darrow
{
    bottom: 20px;
}

#uarrow
{
    bottom: -40px;
}

#darrow, #uarrow
{
    position: fixed;
    left: 50%;
    margin-left: -9px;
    padding: 0;
    width: 18px;
    height: 14px;
    opacity: 0.7;
    z-index: 11;
}

#darrow, #uarrow:hover
{
    opacity: 1.0;
}
#footer
{
    padding: 0;
    width: 100%;
    height: 70px;
    position: fixed;
    bottom: 0;
    border-top: 1px solid #000000;
    z-index: 6;
    background-color: rgba(255, 128, 0, 0.7)
}

JQuery;

$(document).ready(function(){
  $("#darrow").click(function(){
    $("#footer").animate({"top": "+=100px"}, "slow");
    $("#uarrow").animate({"top": "-=50px"}, "slow");
    $("#darrow").animate({"top": "+=100px"}, "slow");
  });
});

$(document).ready(function(){
  $("#uarrow").click(function(){
    $("#footer").animate({"top": "-=100px"}, "slow");
    $("#uarrow").animate({"top": "+=50px"}, "slow");
    $("#darrow").animate({"top": "-=100px"}, "slow");
  });
});

Answer №1

It seems like the intended code was #darrow:hover. This will override the original opacity settings.

The correct code should be:

#darrow:hover, #uarrow:hover
{
    opacity: 1.0;
} 

But instead of that, you currently have:

#darrow, #uarrow:hover
{
    /* This is replacing the previous opacity value of 0.7 for #darrow */
    opacity: 1.0;
}

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

Issue with window.localStorage.setItem not functioning properly on mobile devices

Currently, I am developing an HTML5 mobile application with jQuery Mobile. Below is a snippet of my code: $(document).on("click","#send_mobile_number",function(){ var mobile = $('#mobile_number').val(); var user_id = sessionStorage.get ...

Why does attr() seem to only be applying the last style?

Can someone explain why the attr() function is only applying the last style attribute specified in this code snippet? I would like a detailed explanation of the reason behind this behavior. <!DOCTYPE html> <html> <body> <p id=&quo ...

Ensure the accordion design is adaptable to various screen sizes and orientations, as it is currently only allowing

I'm struggling to achieve responsiveness with the FAQ Accordion on my website. When it initially loads collapsed, the space where it should expand appears blank. I need it to dynamically adjust and create more room when opened up. Additionally, when a ...

Expansive dropdown menu stretching across the entire width, yet the content within restricted to a width of

I have recently made some updates to our website's dropdown menu, expanding the results displayed. However, I would like the dropdown contents to fit within the width of our page. https://i.sstatic.net/aR0Qm.jpg https://i.sstatic.net/e61Ig.jpg I ha ...

Detecting changes in a readonly input in Angular 4

Here is a code snippet where I have a readonly input field. I am attempting to change the value of this readonly input from a TypeScript file, however, I am encountering difficulty in detecting any changes from any function. See the example below: <inp ...

What could be causing my click() function to only work properly after resizing?

It's driving me crazy. The code snippet below works perfectly, but not in my project. Only the code in the resize() function seems to work. When I resize the window, everything functions as expected - I can add and remove the 'open' class by ...

Is there a method to ensure a sequence of jQuery ajax requests are processed in an orderly queue?

I have an array of data (arrData) that I need to loop through (10 elements), making an ajax request for each element. Currently, all the ajax calls are being sent in parallel, causing the server to receive 10 requests at once and respond with the data in n ...

"Employing the ScrollSpy feature in Bootstrap allows you to effortlessly monitor

Recently, I came across a document containing Bootstrap 4 code like the following: <div className="container"> <nav class="navbar navbar-expand-lg navbar-light"> <a class="navbar-brand active" aria-current="true" href="/"> ...

Transform a grayscale jQuery image into a full-color image upon hover

My CSS file includes a black and white image: I also have a color image in the same file: My goal is to change the black and white image to color when hovering over it... I've written a jQuery function for this: $("ul li").mouseover(function() ...

How can you maintain the "link" text in a div while removing the final hyperlink?

I am currently designing a breadcrumb navigation for a website. The breadcrumbs are generated using a templating language before the page is displayed. However, after rendering the page, I need to make some adjustments. Instead of using multiple IF/ELSE s ...

The legend in the fieldset is not displaying correctly due to overflow issues

Within my fieldset, there is a legend structured as shown below: <fieldset class="fieldsetStyle"> <legend class="fieldsetLegendStyle"> <div> <h:outputText value="#{msgs.LABEL_AJOUTER_U ...

Recommendation: 3 options for radio buttons on the registration form

My form includes a section where users need to choose if they want to sign up for a session that occurs 3 times daily. The catch is, only 5 applicants can enroll in each session (AM, Mid-day, PM). It's a competition to secure a spot. Here is the form ...

hiding an "input type="file" element by using a button to conceal it

Is it possible to create a button that triggers file upload functionality? I couldn't find any solutions on Google. I've heard it can be done with labels, but I specifically need to use a button for better UX/UI. <button style="position:fixe ...

What sets Legacy JavaScript apart from its modern counterpart, JavaScript?

Exploring the distinctions in coding practices between JavaScript and jQuery, I came across an interesting concept known as Legacy JavaScript that I was previously unaware of. You can read more about it at this link: Selecting Elements in Different Ways: ...

What is the process for verifying an md-select in Angular Material 2?

Hello everyone. I am currently building an app using Angular and incorporating Angular Material for the UI design. I am familiar with Angular validation techniques. For more information on form validation in Angular, you can visit this link. My questio ...

Using Three JS OrbitControls within a JQuery Draggable interface

My challenge involves using a canvas containing cubes inside a draggable element. I am trying to rotate the camera using OrbitControls, but I am facing an issue where instead of just rotating the cubes, it also starts dragging on left click (I would like t ...

Display a Java applet when HTML text elements are clicked

I am attempting to create a custom jQuery plugin, but I don't have much experience with jQuery and could really use some assistance. Here is the Java Applet that I am referencing: The applet performs certain operations and displays the result in a t ...

The server-side code is not activated when the submit button is clicked

My issue revolves around an ASP.NET page utilizing jQuery. Initially, when I clicked the submit button, it would display the 'object expected' error. Upon inspecting with Firebug, it pointed to the error being related to the 'return validate ...

JavaScript failing to retrieve JSON information from PHP

I seem to be encountering an issue when trying to read JSON data that I create in PHP and send back to my JavaScript. The problem is puzzling me. Here's the PHP code: header("content-type: text/json"); curl_setopt($ch,CURLOPT_URL, $url); curl_setop ...

Replace Font Awesome icon with a background image

Looking to replace a Font Awesome icon with a background image using only CSS. Current Setup: https://i.sstatic.net/tkPXz.jpg .btn.btn-default.bootstrap-touchspin-up:before { font-family: Fontawesome; content: "\f067"; font-size: 14px; } ...