Skip to content

Same Javascript function working for two different divs

I´ve got this javascript function working fine for mobile and i need to use it for desktop but the ids of the elements are not the same, i was wondering if someone could give me a hint on how to approach this. My Html code for mobile: Html code for desktop: I don’t have access to the Html code so

How to remove directions control on mapbox maps?

I’m using the plugin “mapbox-gl-directions” to get distance. I want to remove the direction control inside the maps. Here is an example guide on image => example of what I’m trying to do Is it possible to remove that and keep the distance box? Here is my code: Thank you. Answer Mayb…

How to add a class to the body element in javascript?

So I wanted to code a simple thing in javascript, I have a responsive navbar with the hamburger button: I wanted to halt scrolling whenever the hamburger menu is active. So I wrote this javascript code: And of course I added .noscroll{ overflow: hidden; } to the css file. It didn’t work for some reason …

Canvas 2DPath Clip overlap pr

I’m trying to create one compound shape in canvas that masks all the content below it – i will be animating these paths so they will eventually intersect – the problem is, when they intersect, they are doing a reverse mask when the drawing overlaps. I just want one solid mask. Here is an exa…

How to make Google Interaction

enter image description here I want to implement the interaction of the Google main page. However, it cannot be solved. How do I get it to work in my code or what do I search for? I am a newbie. Below is the code I implemented. https://jsbin.com/yuxojifuxe/edit?html,css,js,output Answer If you want drag-and-d…

Separating Django REST back from Front end

This is a bit of a different question. I’ve tried researching the information for a few hours now and I can’t seem to find what I am looking for. I have a Django REST backend that I set up. Its very simple REST API that has one Model Model.py I’m able to post to via the REST api interface se…