Questions tagged as 'javascript'

1
answer

How to show and hide element according to scroll?

I want to hide the image when scroll of the page is greater than 147, so that's fine, the problem is that I can not hide the image again when scroll is less than 146. The goal is to hide and show the image according to the scroll....
asked by 16.04.2018 / 19:12
1
answer

Buttons generated by foreach only execute ajax in the order they are displayed

Hello! I am using an ajax on a button so when I click on it it submits a form, the button then changes from VALID to VALIDATED, all without reloading the page. Here is the code: $('#validar_form').submit(function(event){ $.ajax({ url:...
asked by 26.04.2018 / 16:24
1
answer

Javascript - Display quantity [closed]

My code is as follows: function adicionar(){ var tabela = document.getElementById('tabela'); var tp = document.getElementById("pedido"); tp = tp.options[tp.selectedIndex].textContent; var qtd = document.getElementById("...
asked by 26.04.2018 / 20:43
1
answer

how to remove object from array with lodash

Personally I do not use lodash and I am not able to remove an element from the array using remove. example: seat = { x:1, y:2 }; selectedSeats = [{ x:1, y:1 }, { x:1, y:2 }]; _.remove(selectedSeats,function(s){ return s === seat; }) I'v...
asked by 23.05.2018 / 18:28
2
answers

Calculation of JavaScript Multiplication

I need to do a percentage calculation on a value, but depending on the number to be calculated (if there is periodic decimal in the result for example) the result is rounded and does not display decimal places, / p> (I am calculating by 1.0...
asked by 22.05.2018 / 16:42
2
answers

Autofocus and Required in hidden fields by javascript

I have a field to select two other fields. When it shows the field situation hides the other div and vice versa, this is working perfectly. I would like to know how I can do to give an autofocus required when the selected field is visible, becau...
asked by 22.05.2018 / 23:07
1
answer

Clear Html Tags from a result of an input, except

How do I remove all html tags from a string with exception? Ex: var exemplo = "<div><p>Leno<span> Sousa</span> <i></i>var exemplo = "<div><p>Leno<span> Sousa</span></p></div&...
asked by 23.05.2018 / 17:46
1
answer

React build vs (?) Webpack?

I'm taking a React course. I have an understanding of what React is, and what problem it solves. However when I put CMD "create-react-app x" it shows some other commands that I can use in this project including "npm run build" which theoretic...
asked by 23.05.2018 / 16:14
1
answer

delete javascript content by name

I need to delete and change the specific plan created with the variable list! every time I delete, deletes all and if I change it deletes all and changes one so! function planoCriado() { var lista; lista = document.getElementById("no...
asked by 22.05.2018 / 17:11
1
answer

Jquery does not run on content loaded with the .load ()

I'm trying to load a page using the Jquery .load () function, I use a modal to display the content on the main page, the problem is that within the modal it has some functions that depend on jQuery (input mask, Jquery DatePicker and others), and...
asked by 03.04.2018 / 16:02