I’m trying to make a text fade in and fade out, alternately, as you click a button, using jQuery. I came up with this code: That works only once (fades in first click, fades out second) and the button stops working forever. If I comment out line 5, the button works once and everytime I press it again, t…
Tag: html
When clicking on a button inside another button, the functions for both buttons are run
I have show-button that, when clicked, expands and shows some text and a collapse-button: When show-button is clicked, it expands and shows the paragraph and the collapse button. When the collapse-button is clicked, it collapses back to the original size where it’s all hidden. The problem is the followi…
React get value from a class
I have a component where i get the distance from one point to another, with Google Maps (DirectionsRenderer). What i want, is to use this data in a h1 This is my return EDIT: ShowProduct.js (This is where i get the distance) ProductCard.js (This is where want to use it) Answer You need to set up a state using…
Render div with state only on phones
is there some way how to render div conditionally with state but only for mobiles? I have show more button, but i need it only for phone resolution, also I need to display that div with className text every time on desktop Answer you can set the active class in the media query. At first, you can this div disp…
Responsive navbar blocks body content once it’s opened
Before you try to make a solution make sure responsive toolbar is enabled on your chrome browser. I am trying to first make the responsive design for mobile then for desktop. But I am having this problem where I open the hamburger menu and the navbar blocks my content. I tried to fix this by doing position: r…
Close other div when new div is opened (in forloop.counter)
I am trying to close the other div when I open a new div, But I am using in loop so I used forloop.counter But it is not working. And when I try to use without forloop.counter or outside the loop then it is working fine, but I want to use inside the for loop. page.html I have also tried
Bootstrap 5: Hide/Show navbar after scroll 300px
I want to hide the Bootstrap navbar after scrolling for 300px. At the moment I’m using the following code (from here). It works but the navbar hides immediately after scrolling. I want it to hide after 300px. Is there a way to add that to the script? HTML: Javascript: CSS: Answer Hello You can solve thi…
Placing a Div behind 3 divs
The aim is to code the design below with 3 boxes appearing on top of a straight vertical line (Horizontal on desktop). I have tried creating this using :: before pseudo selector. Here is the code: I’m unable to hide the pseudo selector behind the parent div. Answer
How to reach a html tag inside a using Java Script?
I’ve got a span tag which placed inside a div, like below: I want to set a border for the span tag as the input tag is clicked and also don’t want to use any id in the span. I’ve tried the bellow ways: 1: 2: but none of them worked correctly! So would anybody help? Answer I would suggest
Div with sprite-animation doesn’t change properly during window.resize event
I am trying to imitate 3d-model rotation with a sprite sheet. I found a perfect example on Codepen, but it was not responsive. What I tried to do is to write divs, containers and spritesize (in script) in vw, and then it is being checked in the window.resize event. It does work, but unfortunately not DURING w…