Questions tagged [toggle]
To toggle a boolean variable is to switch it to its opposite state. If it is on, switch it off; if it is off, switch it on. In a desktop or web user interface, a toggle may be clickable switch or button that alternates the state of something in the application.
5,751
questions
0
votes
1
answer
14
views
React toggle hyperlink of grid header
I am working with react with Web API. I need one solution where I wanted to have one Hyperlink for once of the headers of Grid. And once I click's over the hyperlink, I wanted to hide this hyperlink ...
0
votes
0
answers
18
views
How to prevent Vue.js transition only when I change page
I have a collapsible menu in the left side of my Vue.js app.
The collapsed menu is in one component. The non collapsed menu is in another component.
When I click on a button I switch from the ...
0
votes
1
answer
14
views
Checkbox toggle square getting lost
I have been working on a custom-styled checkbox, but for some reason, the square when the toggle is checked is getting lost.
Anyone could please point out what I did wrong with this checkbox?
https://...
0
votes
2
answers
26
views
How Toggle Works in React
Following is a simple React Toggle functionality. But I have a confusion. In the first click, I understand that the 'setState' function makes the 'state' to 'true' so the content shows. But in the ...
1
vote
2
answers
65
views
Fastest way to "sort" bit sequence by toggling bits
Given a finite random sequence of bits, how can the minimum number of bit toggles necessary to result in a sorted sequence (i.e. any and all 0's are before any and all 1's) be determined?
Note, ...
0
votes
0
answers
24
views
R Shiny: Hiding and showing verbatimTextOutput
I am currently trying to create an R Shiny app with multiple tab panels.
On one tab panel I would like to enter some numbers and then depending on a button show and hide the numbers entered.
I use ...
1
vote
2
answers
46
views
Using Toggle in a password field in jetpack compose
I am trying to use toggle in a password field. This is my code so far but for some reason it wont work. How can I achieve toggling a password as in this image? Much appreciated!
Image: https://gyazo....
-1
votes
1
answer
29
views
.toggle() function w/ classList not working for one element but works for others
I am trying to add a class on an html element when I click on
another element of the page, but despite all my attempts it keeps not working.
Here is my code
html code:
<div class="container&...
0
votes
0
answers
14
views
Toggle the ability to use spacebar when enter is pressed
Currently I am trying to make it so whenever you click enter, it toggles the ability to use the spacebar. It will by default be set to let you not use the spacebar but when the enter key is hit, that ...
-1
votes
0
answers
34
views
SwiftUI toggle change state from UIKit code [closed]
I am new to SwiftUI and trying to implement a new feature into a UIKit code, so I am doing some POCs to check the issues that may face us doing new features using SwiftUI.
My goal is to implement the ...
0
votes
0
answers
17
views
Can anyone Optimize Tab Code with Pure JS? without parameters
I want to optimize that code to make it readable and in less lines. like selecting parent base on class and siblings also. and how I can use JS methods to achieve this output.
I was trying to make ...
-1
votes
0
answers
7
views
Few lines of misunderstood Js code, what do they do? [Js] [duplicate]
can anyone tell me what these few lines of code do? The first 2 from what I understand return the first element that belongs to the class or classes in brackets ... I did not understand then the ...
0
votes
1
answer
36
views
how to replace h2 with div on same page after on click with h2 (and without using component)
I am very new to stack overflow and this is also my first post so I am not sure if this question is specific/detailed enough but...: I am trying to figure out how to replace the h2 element 'Unpack the ...
0
votes
0
answers
15
views
how to close sidebar menu by default using javascript in html
i have a website where i am using sidebar menu, the menu is displayed by default and on button click its hidden:
"use strict";
var tid = setInterval(function() {
if ("complete" === document....
0
votes
0
answers
17
views
Cannot do toggle in Chrome and Edge
Before migrating to Chrome and Edge, we were using IE11 for our website and it got no error. But now, IE11 is dead and must use modern browser for our website. But I found new problem that's I cannot ...
0
votes
1
answer
28
views
Laravel Query Builder How to Context Not Conditions
I have a laravel query
PasswordMovement::whereId($id)->update(['active' => '!active']);
my active field converts to 0 if it is 1. but if it is 0, it doesn't convert to 1?
Laravel Query Builder ...
0
votes
1
answer
22
views
Wrapped Img is not being picked up in JS
I've been stuck on this for a few days. I've tried different selectors and unwrapping the img in the div if that was the problem but no luck. I've been trying to make an accordion.
I'm trying to add a ...
0
votes
1
answer
32
views
How to add Toggle Button Behavior to MDFloatingActionButton in KivyMD?
How to add radio button behavior to MDFloatingActionButton widget? Is there such a possibility or is it impossible?
from kivy.lang import Builder
from kivymd.app import MDApp
from kivy.uix.behaviors ...
0
votes
1
answer
37
views
Toggle Search Input Autofocus
I am running a script when the search icon is clicked the search input is displayed with toggle but I cannot get this running so that the input autofocus is active so the user can type straight into ...
0
votes
2
answers
43
views
WinUI Custom Toggle Switch with intermediate event
I have been scratching my head for some time over this.
I want to have toggle switch that fires an event when pressed and based on the event handler toggles if specific task is completed as expected.
...
0
votes
1
answer
24
views
How can I make my toggle nav button work in BS5?
I am triying to figure out why my toggle icon is not showed,and why the nav bar is not showing the menu elements when I use the mobile view.
I have created a border to see if the icon is there,and I ...
1
vote
1
answer
64
views
How to toggle visible the Highcharts Sankey link with javascript
How can I toggle visible the Sankey link (together with the node and label)?
I want users to expand nodes step by step by clicking on the node. The diagram would have ca 5 levels and ca 10 columns ...
-2
votes
1
answer
27
views
Can't access element's class to change its name in JavaScript
I'd like to change an element's class from score -box1 to score -box1.-active. I created a const $target to try to access the class score -box1 but its not working.
const $target = document....
0
votes
2
answers
39
views
Angular Dialog: How to make the button open or close depending on state
I am using the Dialog component and I need the main button to close the dialog when the dialog is opened.
I am using the dialog with no backdrop overlay because I need the user to interact with the ...
0
votes
0
answers
22
views
Unity toggle group game object not recognised as such
I have a group of four toggles within a Canvas object. I've created an empty game object and called it ToggleGroup. I've then moved the four toggles into ToggleGroup (still within Canvas). However, ...
1
vote
0
answers
34
views
Every Item in React todo List is being crossed
I am trying to make a Todo List in React. Almost everything is working just about fine except the fact that when I click on a particular task, instead of only crossing that specific task, it is ...
0
votes
1
answer
25
views
Toggle on instantiated objects
I have created a Toggle with Unity UI and added a script to it.
So the point is, that my game instantiated a number of objects with a specific tag. I want to find them and toggle on/off their mesh ...
0
votes
0
answers
30
views
classList.toggle for several elements Javascript
I designed a vertical slide from bottom navigation on mobile. I would like each tab could move (up or down) with the upper one. May be the toggle method isn't the right one. I use vanilla JS.
Here is ...
0
votes
1
answer
31
views
jQuery toggle class not responding
I am trying to use toggleclass to build a hamburger menu. I want it to be clickable to display the menu by adding the class active. By default I have the burger icon display none and then adding the ...
0
votes
0
answers
8
views
How to use a toggle switch with tag a href?
I have two html sheets, one in Spanish and one in English, and I want to put a bootstrap toggle switch so that every time I click I am redirected to a different sheet
<li>
...
0
votes
1
answer
58
views
Ag Grid, prevent column hide/show using the column menu
How could I prevent column hide/show using the column menu in Ag Grid?
E.g. let us take the example from over here.
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
...
0
votes
1
answer
37
views
How to toggle with map function
I want to use toggle with map function.
I've tried many things, but I returned to the first code. I know what's the problem(I use the map function, but I use only one toggle variable), but I don't ...
0
votes
0
answers
50
views
Multiple Show More/Less
How does this code works with multiple boxes?
I have a shop and it should work in the category overview for each product.
<div class="text show-more-height">
TEST TEST TEST TEST ...
0
votes
1
answer
26
views
accordian to toggle between paragraph and icon
i tried to create an accordian where click in heading a paragraph will appear and plus icon also disappear and minus icon appear.i set style.display to change between block and none and use if else to ...
1
vote
1
answer
24
views
Accordion is not working when I click the button
I'm trying to add the accordion in my page. But when I click the button it's not toggling.
Here is my Html
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc....
0
votes
0
answers
7
views
Hamburger toggle icon works fine except when trying to leave one page on mobile
The Hamburger icon does not work on just one page from menu in mobile. I can access that page’s contents from the dropdown in mobile. But once there, the toggle icon does not function. The ...
0
votes
0
answers
30
views
How to create code toggle button that displays in HTML?
I have some code I run in jupyter notebook where I code for a toggle button and when I run it in jupyter it successfully hides all code cells and has the toggle hide code button showing and clickable.
...
1
vote
2
answers
44
views
Toggle class(or change style) of element when element in clicked, Vuejs
The way i am getting data is little bit complicated. I have "tweets" array where data is stored and each tweet is a card where i successfully change style when card is clicked(markTweet ...
0
votes
0
answers
39
views
JavaScript switch divs by class list add,remove / toggle? how I can write better code?
I am a beginning programmer and I would like to ask how can I improve this code? I know it's bad because there are a lot of repetitions and I would like to know how I can make it effective?
Thank you ...
0
votes
0
answers
31
views
Two toggles for dark mode - one of the toggles not changing when prompt but the function is working
So I am making a dark mode for a shopify. So far everything has worked but I want to have the same toggle in two locations, one for mobile, and one for desktop, since I have a sidebar menu on mobile. ...
0
votes
1
answer
42
views
Connect two toggle buttons to switch each other
I have two toggle switch buttons in which button 1 is checked as default. When clicking the 1st button, the 2nd button should be on and the 1st button should be off and after clicking the 2nd button ...
0
votes
1
answer
40
views
How to toggle active class of tabs in React?
I made 2 buttons 'Login' and 'Register'. I wanna toggle the active class on these button if the user wanna login or register. Here is the code.
const [buttonStatus, setButtonStatus] = useState('');
...
0
votes
0
answers
51
views
Documentations/User Guide for HP Programmable Key
I have downloaded (from Microsoft Store) and run HP Programmable Key.
However, I cannot figure out how to use it. I have googled with multiple search phrases but I cannot find a user guide/manual for ...
0
votes
3
answers
45
views
Close an ExpansionTile when another ExpansionTile is tapped
I have a list of ExpansionTile with a list of ListTile in a Drawer. What I want to achieve is, when I press an ExpansionTile, the another ExpansionTile must be collapsed. I had been stuck with this ...
0
votes
0
answers
26
views
Please tell me what is the meaning of the Boolean this expression returning? ( entry.target.classlist.toggle.valueof )
I want to trigger an if statement when the intersectionObserver API toggles a class in the DOM Element.
I am just not sure what exactly is the boolean value returned by this expression: -
entry....
0
votes
0
answers
20
views
rd-navbar toggle color - can't seem to change it
Can't seem to change the color of the toggle from white to red. You can see in the CSS that I've tried. Just getting back into coding so...
I have changed the css where it seems logical but obviously ...
0
votes
2
answers
41
views
onclick button toggle icon not working in reactjs
Here i try to toggle react icons when click the button but it still not working:
Here is my code:
const [anchorEl, setAnchorEl] = useState(null);
const open = Boolean(anchorEl);
const handleClick ...
1
vote
1
answer
47
views
Toggle one list item at a time with React/TS functional components
I have a simple component with a few nested bits of mark-up:
import React, { ReactElement } from "react";
type MenuItem = {
title: string;
subItems?: Array<string&...
0
votes
1
answer
45
views
React toggle theme and save it to localStorage and also toggling classes to the html body tag
Please take a look at my code the toggle button is working completely fine but I also want to save the toggle state to localStorage I have tried it so many times before especially with Vanilla JS but ...
0
votes
0
answers
24
views
Collapse/expand targeted section bootstrap not working
My goal is to toggle a specific section to expand or collapse a list of numbers. I am using Bootstrap for a toggle button to control this section, but it isn't working. I have been trying different ...