Posts by Lucas Fontes Gaspareto • 3,656 points
86 posts
-
0
votes2
answers151
viewsA: Remove div if input is empty
I’m going to show you another way to do this, a little clearer and that might bring you more knowledge about logic. var inputValue = $('#usuario').val() // so ira entrar no IF se o valor for…
-
0
votes2
answers208
viewsA: Value Textarea does not work React
Hello, the function that will deal with changing the textarea should be initiated in the constructor, example: ... this.state = { taskEdit: [], title: '', description: '', project: '', service: '',…
-
0
votes1
answer75
viewsA: Firebase Two foreach duplicating data
Hello, the error is happening because you are not cleaning the variable content after allocating the consultation. Here is an example of how it should be corrected ... table.innerHTML += text…
-
0
votes1
answer313
viewsA: Capture changes that have been rendered with state in vueJS
Before presenting an alternative to your case, follow an information that justifies the way I will do. Vuex has a configuration called Strict mode, which may be true or false, this setting with…
-
0
votes2
answers788
viewsA: Jspdf error with Vuejs
Hello, I didn’t "debug" your code to understand where the error happens, however, I’ve used jsPDF with jsPDF-AutoTable And I believe that this can serve what you need. Assuming you already have a…
-
3
votes1
answer479
viewsA: Dropdown Menu (VUEJS/Javascript)
Hello, Looking for a simple way to implement functionality click-Outside in the element, I found this directive. Besides, I couldn’t think of any other way than by directive. Below is an adaptation…
-
1
votes0
answers98
viewsQ: Keystonejs with remote Mongo
Good night! I’m starting to study Keystonejs versão 0.3.17. Following the "Getting Started" of the official website, in the prerequisites nodejs and the mongodb, but I want to use that cloud service…
-
0
votes1
answer32
viewsA: CSS - inputs are not aligned
Hi there, Diana, hello! There are several ways to do this, I’ll show you one. The tag span, by default, comes with display: inline;, that will not work with the property width which I will use for…
-
3
votes2
answers417
viewsA: "Cannot read Property" after an http.get request
Renan, use your controller this way to see if it will solve the problem. .controller('chartEvapo', function($http, $scope) { var teste; $http .get(meurepositorio) .success(function(response) {…
-
5
votes2
answers2823
viewsQ: Margins of the child element leaking to the parent element
I didn’t find in the community something that would clear my doubt, so let’s go! In the example below, I don’t know why water loads, the property margin of the elements p and h1 exceed the parent…
-
22
votes4
answers1870
viewsQ: What are Progressive Web Apps?
Hello, I’ve read references around, and to complement our community, follow the questions. What exactly is Progressive Web App (PWA) or Web Application Progressive? What advantages there are…
-
1
votes1
answer715
viewsA: I need to put a link in my Google Maps
Try adding a listener for the event click on marker as in the example below. Using the property window.location you will be able to redirect to a path within the site.…
-
3
votes1
answer505
viewsA: Receive values (popup) on parent page
Come on, to get the data you use the same function($(this).val()), within the each, which is assigning the values in the div#idPai of HTML. To store these values in a array you declare a variable…
-
0
votes1
answer38
viewsA: Soma using Meteorjs
If the time format is Hora:Minuto. Example: 02:00 (Duas Horas). Creating a new property on helpers of the template list you can return the total hours, see in the example below how it would look in…
-
0
votes2
answers580
viewsA: Limit sidebar before footer
I developed a script using javascript only with a layout example applying this situation that described. I will try to explain what he does, maybe it is a little complex to understand, I am…
-
0
votes2
answers283
viewsA: Scroll of window size
I developed an example, just below, that basically does what I said in the comments of your doubt. I created a Istener of the scroll event which checks on ranges, which are the offsetTop of sections…
-
0
votes2
answers1725
viewsA: DIV with height:auto; does not readjust according to the height of the internal DIV
Use the property overflow: auto. Will stay like this. .conteudo-modelo-3-0 { width:960px; height:auto; margin: 0 auto; overflow: auto; } .conteudo-modelo-3-1 { position:relative; width:840px;…
-
8
votes1
answer1031
viewsQ: Table structure for genealogical tree
How to create a table with genealogical tree structure for an individual using a concise nomenclature? Example: Individual Father Father (Paternal grandfather) Father (Paternal great-grandfather)…
nomenclatureasked Lucas Fontes Gaspareto 3,656 -
2
votes1
answer456
viewsA: Problems with Javascript Currency Formatting
The mask is applied every time a certain event occurs in the field. When you enter the value, the mask is applied. Because multiple input events are occurring, every time you reload the page and…
-
1
votes3
answers229
viewsA: How to add new jquery inputs through a number of a text box, but add only those that are missing
Without making many modifications to your code, an alternative to do what you need is to look for the number of children that the #divForm has and subtracts the amount reported in txtQuantidade, in…
jqueryanswered Lucas Fontes Gaspareto 3,656 -
1
votes2
answers7394
viewsA: How to change color of css header only
Assuming that your header is the tag properly said, read about this tag of HTML5 magnificent here.The interaction between HTML and CSS allows you to add classes in tags HTML, as an example…
-
7
votes0
answers71
viewsQ: How does "this" work in Javascript?
I’d like to better understand how this run in Javascript. What is he ? What are its functions in language ? And how your scope works in code ?…
javascriptasked Lucas Fontes Gaspareto 3,656 -
4
votes5
answers8511
viewsA: Reverse array order
Like the Tobymosque responded, on the amendment in array, I developed another alternative for the occasion. I set a function for the prototype Array, this function handles the this, which is nothing…
javascriptanswered Lucas Fontes Gaspareto 3,656 -
1
votes3
answers978
viewsA: What is this <Buffer> in reading files in NODEJS?
Responding roughly. This <buffer ...> corresponds to binary data allocated in memory, memory this out of heap V8. Buffer in the Nodejs: Buffer is the instance of a class in Nodejs. Each buffer…
node.jsanswered Lucas Fontes Gaspareto 3,656 -
5
votes2
answers239
viewsA: Variable control with Javascript for html
Your problem lies in the scope in which the variable was declared. If you declare a variable within the function, its lifespan will be equivalent to that of the function. One way around this is by…
-
1
votes1
answer162
viewsA: How to get the values of the last 4 columns with Jquery
Using the jQuery selector together with the array function forEach you can select the last 5 elements of the set, add the first 4 and when you arrive at the last assign the total value of the sum.…
-
2
votes1
answer104
viewsA: How to access link with parameter through html or Html5 form?
Using Javascript only, you can do so: document.getElementById('enviar').addEventListener('click', function(e) { var param = document.getElementById('param'); var act =…
-
4
votes1
answer179
viewsA: How to make the position of a moving div be saved automatically?
If I understand your question, you have a div that scrolls over the page and you want always the last position occupied by it to be saved by loading the page again, correct? Well, if that’s what it…
-
22
votes9
answers34793
viewsA: Input type="password" with password display eye
Using Javascript only, you can add to an element, in this case it is the tag img, two events (mousedown and mouseup), these will change the property type of input, alternating between text and…
-
5
votes1
answer188
viewsA: textContent Material Designer Angular JS
The version you are using probably predates 1.0.0, in previous versions rather than textContent the function was called only content. You can follow the examples of the official website according to…
-
40
votes3
answers20821
viewsQ: How to define a software version?
I would like to know what the number of software versions are and how they work, for example v1.1.2 what does ? Is there any standard or recommendation for web application versions ?…
-
4
votes1
answer1098
viewsA: What alternative to use instead of Document.write
If it is possible not to declare a tag script calling the function to add HTML to the div where you are. You can try creating a div with custom attributes and from there search for elements that…
javascriptanswered Lucas Fontes Gaspareto 3,656 -
3
votes1
answer54
viewsA: Identify a specific part of the screen
You can create an event in the window to detect mouse movement and with it his pageX/Y. window.addEventListener('mousemove', function(event) { if(event.pageY > 400) { //{...} } else { //{...} }…
-
2
votes3
answers504
viewsA: Disable input text by clicking another input text
From what I understand, you need that when clicking on one input the other one disables right? Then I made a script using Javascript only. document.addEventListener('click', function(e) { var self =…
-
4
votes2
answers663
viewsQ: How to change setInterval delay programmatically?
I tried this way but did not succeed. My intention is to make as an effect of the Bézier curve. var count = 0; var times = 100; var fn = function() { count++; if(count === 25) { console.log(count,…
javascriptasked Lucas Fontes Gaspareto 3,656 -
3
votes1
answer28
viewsA: Remake SASS loaders for CSS
As mentioned by @Caio Felipe Pereira. In the CSS frame bar there is a button with the option to see the compiled SASS code for CSS. In any case, follow the compiled code also. body {…
cssanswered Lucas Fontes Gaspareto 3,656 -
2
votes2
answers119
viewsA: The function I’m calling doesn’t appear, what’s wrong?
Friend, I took the liberty of adjusting a few things in your script, I hope you can add in your application. // Adiciona um evento ao document para quando a pagina estiver carregada. Substitui o…
-
3
votes7
answers4205
viewsA: Count elements on the screen
This way it is possible, the script will scan all elements li. @Edit: Simplified form. var elementos = document.getElementsByTagName('li'); document.writeln('Existem ' + elementos.length);…
-
3
votes1
answer42
viewsA: Google javascript maps makers. What’s wrong?
I did a test with your code and it presented problems in the declaration of array values, except this, it worked perfectly. Here is an example of how you should declare values. var pontos = […
-
4
votes1
answer140
viewsQ: requestAnimationFrame, setInterval and setTimeout
I would like to understand more about the nature of these three functions cited above. What is the main objective for each one? In the case of animations, which is the best option for changes in the…
javascriptasked Lucas Fontes Gaspareto 3,656 -
2
votes4
answers318
viewsA: Div inside another broken div
Each element in HTML has a property display, in the case of <div> the display is defined as block by default. The block "says" to each element that owns it to always start on a new line, in…
-
1
votes3
answers1147
viewsA: Add and remove styles of a particular selection by clicking a button
An alternative that follows the same logic as the first answer, but with a different syntax: document.getElementById("toggle").addEventListener('click', function() {…
-
-1
votes8
answers14487
viewsA: How to create a copy of an object in Javascript?
An alternative to creating an Object whose prototype inherits another Object is the function developed by Douglas Crockford: if (typeof Object.create !== 'function') { Object.create = function (o) {…
-
9
votes1
answer1403
viewsQ: Save image link as file in Storage location
How can I save a link (http://example.com/img.png) in the file format, which in this case is . png, using Javascript and saving in the local $localStorage angularjs?…
-
3
votes2
answers1977
viewsA: Break Line Correctly in a List with Data Binding Angularjs
Using the css attribute word-break: break-all; you can break the lines of the comment. Can i use word-break? Reference: MDN - word-break…
-
3
votes1
answer112
viewsQ: $ionicLoading, template does not work
When I call the call show() passing the attribute content: '...' loading text is changed as below. $rootScope.loading = $ionicLoading.show({ content: 'Loading...' }); But when I use template, as…
ionicasked Lucas Fontes Gaspareto 3,656 -
7
votes1
answer4160
viewsA: Simulate click with jQuery after inserting link via jQuery
Instead of using the function $(seletor).trigger("click"); use $(seletor)[0].click();. Good, but because? According to @The Alpha’s response to this question, what happens is that in the case of the…
-
2
votes1
answer238
viewsA: Javascript function run on each element
First of all, this is happening because you have declared several attributes id with the same value, this is highly not recommended, is a bad practice and will cause many future problems. To solve…
javascriptanswered Lucas Fontes Gaspareto 3,656 -
0
votes3
answers72
viewsA: Page does Submit even with validation error
So that the page does not run Ubmit when function return validar(); for false use this condition together with the negation operator !: if(!validar()) { e.preventDefault(); } The e is the parameter…
-
0
votes2
answers1329
viewsA: Press page and at the end click on a button automatically
Using the scripts below you can run the event by clicking on a input of the kind file, but only in some browser with older versions, as mentioned in this question Soen. So it won’t help you but it…
javascriptanswered Lucas Fontes Gaspareto 3,656