css

transform: translateY(-50%) causes 1px jump/shift in IE and EDGE

大憨熊 提交于 2021-02-11 05:00:10
问题 Please see an example in jsfiddle. https://jsfiddle.net/0uwmxt02/1/ In IE and EDGE the transform: translateY(-50%) causes 1px jump up and down at the start and end of the animation. In Chrome the displacement still occurs but it is smooth. Any idea of what causes it? .submenu-arrow-hover { position: relative; width: 200px; top:50px; } .submenu-arrow-hover:after { //background: rgba(155, 173, 188, 0.9); position:absolute; content:''; width: 1px; height: 28px; border: 1px solid red; border

transform: translateY(-50%) causes 1px jump/shift in IE and EDGE

旧时模样 提交于 2021-02-11 04:58:56
问题 Please see an example in jsfiddle. https://jsfiddle.net/0uwmxt02/1/ In IE and EDGE the transform: translateY(-50%) causes 1px jump up and down at the start and end of the animation. In Chrome the displacement still occurs but it is smooth. Any idea of what causes it? .submenu-arrow-hover { position: relative; width: 200px; top:50px; } .submenu-arrow-hover:after { //background: rgba(155, 173, 188, 0.9); position:absolute; content:''; width: 1px; height: 28px; border: 1px solid red; border

A way to not hardcode items in css with R Shiny app?

帅比萌擦擦* 提交于 2021-02-11 04:51:33
问题 I have the below code example (taken from here) . Is there a way for the below to work without hardcoding the values "a" and "b" in the html css? If I have hundreds of items I don't want to have to hardcode each one in the call to .option[data-value=a] etc. shinyApp( ui = shinyUI(fluidPage( tags$head( tags$style(HTML(" .option[data-value=a], .item[data-value=a]{ background: red !important; color: white !important; } .option[data-value=b], .item[data-value=b]{ background: green !important;

How to add class to buttons on click

非 Y 不嫁゛ 提交于 2021-02-11 04:27:39
问题 Sorry for silly question , but I can't add class to button on click. I have list of buttons and on click I need to change background of active button . I dont know how to get index of element on click inside list and add class. I need to make it on pure javascript. Only need to leave $(document).ready(function() . Here is my fiddle https://jsfiddle.net/armakarma/ns5tfcL0/15/ HTML <div class="content-itinerary__buttons-wrapper"> <button class="content-itinerary__buttons description-text ">Day

How to use Two Toggle buttons on same page having same function with different css?

浪尽此生 提交于 2021-02-11 04:26:34
问题 I have been trying to hard to add 2 Toggle Buttons having different styles (css) on Menu Bar and footer page. They are to be used for night and dark mode. However when I use onclick="themeToggle()" id="theme-switcher" for both of the buttons, only one of them works. This is my Toggle Buttons Test Page. This is the js which is being used : var tSwitcher = document.getElementById('theme-switcher'); let element = document.body; let onpageLoad = localStorage.getItem("theme") || ""; if(onpageLoad

How to use Two Toggle buttons on same page having same function with different css?

偶尔善良 提交于 2021-02-11 04:25:48
问题 I have been trying to hard to add 2 Toggle Buttons having different styles (css) on Menu Bar and footer page. They are to be used for night and dark mode. However when I use onclick="themeToggle()" id="theme-switcher" for both of the buttons, only one of them works. This is my Toggle Buttons Test Page. This is the js which is being used : var tSwitcher = document.getElementById('theme-switcher'); let element = document.body; let onpageLoad = localStorage.getItem("theme") || ""; if(onpageLoad

How to add class to buttons on click

99封情书 提交于 2021-02-11 04:25:44
问题 Sorry for silly question , but I can't add class to button on click. I have list of buttons and on click I need to change background of active button . I dont know how to get index of element on click inside list and add class. I need to make it on pure javascript. Only need to leave $(document).ready(function() . Here is my fiddle https://jsfiddle.net/armakarma/ns5tfcL0/15/ HTML <div class="content-itinerary__buttons-wrapper"> <button class="content-itinerary__buttons description-text ">Day

How to use Two Toggle buttons on same page having same function with different css?

喜你入骨 提交于 2021-02-11 04:24:23
问题 I have been trying to hard to add 2 Toggle Buttons having different styles (css) on Menu Bar and footer page. They are to be used for night and dark mode. However when I use onclick="themeToggle()" id="theme-switcher" for both of the buttons, only one of them works. This is my Toggle Buttons Test Page. This is the js which is being used : var tSwitcher = document.getElementById('theme-switcher'); let element = document.body; let onpageLoad = localStorage.getItem("theme") || ""; if(onpageLoad

Adding a class based on current day of the week

心不动则不痛 提交于 2021-02-11 03:00:26
问题 I've got a bunch of tabbed divs on a page for each day of the week, which are being shown/hidden with jQuery when clicked. The class "first", added manually to whatever tab I want, tells the page which div to show when the user first lands there. At the moment it is set to the Monday div. How would I go about setting this up so that jQuery can add the class dynamically to the actual current day's div instead of hard coding it? Divs are set up like this (with Monday being currently selected):

Adding a class based on current day of the week

孤街浪徒 提交于 2021-02-11 02:49:58
问题 I've got a bunch of tabbed divs on a page for each day of the week, which are being shown/hidden with jQuery when clicked. The class "first", added manually to whatever tab I want, tells the page which div to show when the user first lands there. At the moment it is set to the Monday div. How would I go about setting this up so that jQuery can add the class dynamically to the actual current day's div instead of hard coding it? Divs are set up like this (with Monday being currently selected):