Questions tagged as 'javascript'

1
answer

How to put scrolling dalay in a background? [duplicate]

I would like the bg of my section to have a certain delay in the scroll speed to differentiate itself from the default scrolling of the page. Does anyone know how I can do it?     
asked by 31.01.2018 / 20:42
2
answers

iterate array with element id to show / hide

I have several arrays that hide or display fields based on the change event of a select, the problem is that by iterating the array with the id of the elements only the last value of the array is displayed, as if the instruction inside the loo...
asked by 30.01.2018 / 04:41
1
answer

Why is it possible to change constant values in JavaScript arrays?

Having the following code: const arr = [1,2,3]; console.log(arr); arr.push(4); console.log(arr); arr.pop(); console.log(arr); How much of% should not be constant? And why should not you accept the method arr and push() ? After...
asked by 24.01.2018 / 13:55
1
answer

AutoClick only in class within class

I would like to perform a sequenced autoclick on only one link at a time and only on the class="mobile" that has a class="check-handler". Thanks to anyone who helps me because I have tried several scripts but so far nothing. (A)<div class="...
asked by 12.05.2018 / 15:44
2
answers

Insensitive search when typing in INPUT

I have the JavaScript search engine below. The problem is that when I type the word " tomato " it looks for the word " tomatoes ". It's probably a sensitivity problem or you're just picking up part of the typed word. Would it be possible to fix...
asked by 09.05.2018 / 19:44
2
answers

error at the end of the loop in slide show

I have the following JS window.onload = function() { var indexAtiva = 0; const lis = document.getElementsByClassName('slider').item(0).getElementsByTagName('li'); function slider() { for (i = 0; i < lis.length; i++) {...
asked by 08.05.2018 / 19:31
1
answer

photo with distorted webcam using html5 + javascript

Using the code below, I can capture a camera image through the browser, but taking into account that I want a 4x3 portrait format (354x472px). From the way the measurements are indicated, in the capture it leaves in landscape and in the snapshot...
asked by 10.04.2018 / 19:58
1
answer

Mouse eventListener does not work

I took this example below the book "Eloquent JavaScript" 2nd edition in Portuguese pg.184. The goal is to draw points on the screen using clicks: every time the mouse is clicked, a blue dot is created where the mouse is pointing. But beyon...
asked by 15.04.2018 / 19:55
2
answers

How to add a class to an HTML element, through JavaScript. In my case, I need to add a class in the h1 element below

I need to add a class in element H1 var div = document.createElement("div"); var h1 = document.createElement("h1"); var p = document.createElement("p"); h1.textContent = "Me Ajuda"; p.textContent = "Preciso adicionar uma classe"; d...
asked by 09.04.2018 / 02:19
1
answer

Catch the margin of the previous element and add another value to the next one

I have the following code: <script> $(document).ready(function() { $("div#bloco div").css({ "background-color" : "red", "height" : "50px", "width" : "50px" }); $("div#blo...
asked by 10.04.2018 / 18:11