Skip to content

Tag: javascript

OGX.JS How to have multiple mouse/touch events?

I’m trying to get the distance after a touch/mouse move over 2 separate elements in OGX.JS. I use the built in touch dist, which works But how to I add another one? If I add another instance like that, it just overwrites the first one. Thanks Answer You have to create another instance of touch.dist, whi…

How to scroll to the desired element in React?

I have a question – I have a list that is in a separate popup with a limited height. After this height, a side scroll appears. I need to scroll to a specific element automatically when that component is rendered. How to implement it? I just can’t figure out how to scroll to a certain element. Belo…

js: fill object with array elements using reduce()

trying to learn reduce() but can’t understand it well yet. Maybe someone from you could help me with my problem. I have an object with defined keys and an array. I would like to fill up the objects keys with the arrays values using reduce(). My sandbox LINK Till now I tried something like this: expected…

how to expand an image on click with JS?

I created a gallery using the following codepen and now I’m trying to add the function click to expand an image, using this JS method. Sadly I cannot get it to work. Any advice would be very helpful, either regarding this expand option or an alternative. Mind you I’m completely new to JS. Thanks i…

Change the color of elements in Select from MUI

It seems that there were quite a lot of questions and answers on this topic, but I could not find anything suitable for myself. I ask the community for help. I’m using the Select component from @mui/material to display the number of records per page. And I’d like to change the color of the window&…