Adjust the transparency level when hovering in an R Shiny application

I have an absolute Panel in my R shiny app and I am attempting to adjust its opacity based on the mouseover action. The goal is to have the opacity at 1 when the cursor is on the panel, and 0.5 otherwise.

However, the code I tried ended up making the panel transparent regardless of the mouseover action.

fluidPage(
    tags$head(tags$style(
        HTML('
            #input_date_control {opacity : 0.65;}
            #sel_date {opacity: 1;}')
    )),
    
    absolutePanel(id = "input_date_control", class = "panel panel-default", fixed = TRUE,
                  draggable = TRUE, top = 60, left = "auto", right = 20, bottom = "auto",
                  width = 230, height = 213,
                  
                  box(title = 'Selector', width = 11.5, status = 'primary', solidHeader = TRUE,
                      
                      tags$head(
                          tags$style(
                              ".selectize-dropdown, .selectize-input, .selectize-input {
                                  line-height: 10px;
                               }"
                          )
                      ),
                      
                      selectizeInput("disease", label = "Select disease('s)",
                                     choices = unique(salmonella_all$Disease), multiple = T,
                                     options = list(maxItems = 12, placeholder = 'Select a disease'),
                                     selected = "Chlamydia"),
                                  
                      dateRangeInput("daterange", "Select date range:",
                                     start = "2014-01-07",
                                     end   = "2017-10-15",
                                     min = "2014-01-07",
                                     max = "2017-10-15"
                        )
                    ))
)

See the output of the code here.

The desired outcome is for the panel to be transparent when there is no mouseover, and opaque only when the cursor is over the panel.

Answer №1

Utilize

 #sel_date:hover{
opacity: 1;
}

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

Ways to display or conceal a moving svg based on the current tab selection

Below is the fiddle and snippet: https://jsfiddle.net/e130kr2x/ I've successfully achieved animating the SVG when a tab is active, but I'm facing difficulty in making it not display or fade out when opening a new tab. The new tab should activate ...

Shifting an html element from side to side using javascript click event

I am new to utilizing JavaScript in conjunction with HTML elements, and I am seeking assistance in crafting a function for such interaction. The goal is to have an image that will shift either left or right based on its previous movement. For instance, up ...

How can we randomly sample points closer to the present day?

Here is a dataset I have in R: date = sample(seq(as.Date('2015-01-01'), as.Date('2022-08-12'), by = "day"), 1000) var1 = rnorm(1000, 1000,1000) var2 = rnorm(1000, 1000,1000) var3 = rnorm(1000, 1000,1000) question_data = data.frame(date ...

The JavaScript code for summing two numbers is not functioning as expected

My HTML code takes a user input number, performs a calculation using a formula, and displays the output. The chosen input is inserted into the formula, and the result is added to the original number. However, there seems to be an issue with adding decimal ...

Ways to conceal scrollbar track

Is there a method to conceal the track of the scrollbar while keeping the thumb visible? The desired appearance is shown in the following image: https://i.sstatic.net/6TqmM.png However, the current view is as follows: https://i.sstatic.net/tdJq3.png Th ...

Transfer the CSS editing function from the user interface to the server in a Shiny application

Is there a way to dynamically change the color of input sliders globally? I am familiar with using chooseSliderSkin from the shinyWidgets package to modify CSS and change colors. However, I am facing an issue where this only works in the UI section and no ...

The animatedModal.js dialog box is causing the link to be unclickable, despite having a z-index of -9999

I am currently utilizing animatedModal.js for creating simple dialog boxes on my website. Everything is functioning perfectly, except for one issue - I am unable to click on the link to my logo at the top of the page because the modal with opacity:0; z-ind ...

adjust the dimensions of the clickable icon's background

Is there a way to expand the pressable area of a close icon without altering its size? For example, if the icon is 19X19 pixels, can the pressable area be increased to 39X39 pixels? The concern lies with the div element containing the close button and the ...

Issues with iOS 7's absolute positioning not functioning properly within a table-responsive container

I successfully implemented fixing the first two left columns in my tables by following the instructions on . The columns are only fixed when the screen size is less than 768px, making the table scrollable (check it out on jsFiddle). This functionality work ...

After selecting "ok" on the JavaScript alert dialog, the webpage will automatically refresh, causing all information entered into the textboxes to be erased

<?php include "dbconfig.php"; session_start(); ?> <!DOCTYPE html> <html> <head> <title>Log in</title> <link rel="stylesheet" type="text/css" href="styles.css"> <link rel="stylesheet" type="text/css" href="bo ...

Unable to specifically identify or focus on this offspring

I am attempting to target the class has-translucent-status-bar nested within another class called platform-ios To achieve this, I have used the following code: .platform-ios > .has-translucent-status-bar Unfortunately, this approach has not been succ ...

Troubleshooting CSS Navigation Drop Issue Specific to Google Chrome. Seeking Feedback on Rails Tutorial Experience

I'm currently working my way through the amazing Rails Tutorial and have encountered a problem with the Navigation bar dropping down into the body of the page, but this issue only seems to occur in Chrome (I'm using Linux, Ubuntu 10.10). I'v ...

HTML link with "mailto:" not opening in a new tab

Just posted for the first time! I'm attempting to create a mailto link using 'templated' JavaScript that pulls specific data from a JSON object: var menu = { "menu": [ { "title": "let's talk", "link": "mailto:<a href ...

Ways to update the color of the mat-dialog-title using the material theme

Currently, I am utilizing the Angular Material Dialog and have been attempting to dynamically change the title color of the dialog based on the material theme. <h1 mat-dialog-title color="primary">{{ title }}</h1> Even though setting ...

Make the navigation bar stay at the top of the page when scrolling past another element with a top position of 100vh

Trying to explain a unique concept here. I want a nav bar fixed in the position of top:100vh, so that as I scroll down and reach the next section, the navbar sticks at the top rather than staying stuck at the beginning with position:fixed top:0. The aim is ...

What steps should I take to transition from a 302 temporary to a 301 permanent redirect code?

I am facing an issue with a 302 temporary code on one of my websites. I have been able to identify the code, but unfortunately, I am struggling to locate it. Can someone please help me find where the code is located and guide me on how to change it from ...

Ways to present a pop-up dialog box featuring word corrections

I have developed a word correction extension that encloses the incorrect word in a span element. Upon hovering over the word, a drop-down menu with possible corrections should be displayed. However, my current code is not functioning properly. How can I en ...

Shift a Div to the left prior to stretching it out

I am trying to achieve a smooth leftward movement and expansion animation for a div. Currently, I am experimenting with class switching on click events to transition between the desired states. However, I am facing difficulty in making the element first mo ...

Browser displaying a CSS error: "Invalid property name" while applying pseudo-element :after

I encountered an issue in Chrome and Explorer while attempting to set a CSS property for a pseudo element :after. (I'm trying to create a styled burger nav icon) The error message I received was: 'Unknown property name' This happened wh ...

The appearance of the mock button varies between the development and production environments due to CSS styling

I'm currently using CSS to style a hyperlink in order to give it the appearance of a button. This is for a .NET website. a.pretend { display:inline-block; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-bottom:1px solid #999999; b ...