Posts by LeAndrade • 8,475 points
404 posts
-
5
votes1
answer570
viewsQ: How to leave the background of a text the size of the text and not the paragraph?
How do I make for the background-color of h4 be only the width of the text. I can’t delimit a fixed width because I don’t know the size of the text and I can’t use display:inline-block why need the…
-
0
votes2
answers59
viewsA: Jquery Validation only after dropdown is selected
As I said in the commentary you don’t need the validate for this, in the example I made when marking the checkbox you automatically let the select with required=true and by cancelling the checkbox…
-
9
votes2
answers188
viewsA: reverse push order
UNSHIFT If you want you can use the method unshift. If you want to know more read here. var nomes = ["João", "Maria", "André", "Marcia"]; nomes.unshift("Luís","Adriano"); console.log(nomes);…
-
1
votes3
answers341
viewsQ: Doubt in Vue computed method using Vuex
I have the following code below using Vue.js and Vuex. This code increments and decreases value as a counter. I would like to know what the method refers to count inside computed in Vue instance. I…
-
3
votes2
answers188
viewsA: Include html fields in the title panel
As Hugo said, it’s semantically incorrect to use div inside h, you can style the text with CSS instead, but if it’s a structure that has to be this, you can put a Row after the H3 and a class…
-
1
votes2
answers181
viewsA: Configuring modal with bootstrap
One way to adjust this is by putting a div class="row" after the form-group: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <link…
twitter-bootstrapanswered LeAndrade 8,475 -
0
votes1
answer77
viewsA: jQuery Scrollto does not work! Help me? Cannot read Property 'top' of Undefined
Your code works perfectly, if you don’t put a div with the id Querofazerparte, how do you want the code to work? You in the tag a is calling a ID with the # <a href="#QueroFazerParte>", only…
-
1
votes1
answer56
viewsA: Bootstrap Responsiveness - Grid Issues
What you did wrong was when dividing the columns into the classes: In the div containing the img place col-sm-12 col-lg-3 and in the div containing the text place col-sm-12 col-lg-9. This way when…
-
2
votes1
answer691
viewsQ: What’s the difference of putting -g in package installations by npm, webpack, etc...?
It’s been a while since I installed packages via prompt with npm, Bower among other package managers, but I never really understood what the command is for -g. I know it means global, installing the…
-
1
votes1
answer883
viewsA: recover id value from select and get the selected value from that select
You can do it like that with jQuery: $("select").on("change", function() { var id = $(this).prop("id"); // pega o id do select clicado var val= $(this).val(); // pega o valor do option selecionado…
-
0
votes1
answer90
viewsA: Extend the image outside the container on the left side
That’s how I’d like you to stay: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <div class="blog_section"> <div…
-
1
votes2
answers45
viewsA: Failure to trigger an event
The problem there is that you have declared the variable name var countPalpites = 1 and then in your code you call her twice wrong with countdown and countingPalpite: var numeroAleatorio =…
-
0
votes1
answer482
viewsQ: Does Npm run without Node installed?
Use here in the company a Linux Ubuntu, and installed the Vue-cli for npm version 3.5.2, installing the folder Node-modules usually with all the dependencies inside, but when I ran a node -v it…
-
0
votes2
answers212
viewsA: HTML5 concatenate checkbox with text name
You can thus concatenate the value of the radio input chosen with the user name as follows with Javascript pure: function concatenar(){ var inputs =…
-
1
votes1
answer68
viewsA: Parent element Child account in DOM change
That’s what I’d be wanting to count the child elements of the div: $(document.body).on("click", function() { $(".mensagem-list").append($("<p>Um novo parágrafo!</p>")); var n =…
-
1
votes7
answers1322
viewsA: Push element from one array to another array
as our friend Máttheus said, using foreach becomes more readable. var array = [1, 2, 3, 4, 5]; var par = []; var impar = []; function PickIt() { array.forEach(function(v,i) { // v -> valor do…
javascriptanswered LeAndrade 8,475 -
1
votes2
answers43
viewsA: Element selector: Select above the tenth element
Just to leave a recorded response here on the site using selectors from jQuery just as it is possible to do without using any script only with CSS: Select up to the ninth:…
-
1
votes1
answer25
viewsA: Arrays comparison or best method to add new elements
Pose to do so if you like, testing if one element does not exist in the other: var json = [9,8,7,6,5,4,3,2,1]; // elementos à adicionar var tela = [4,2]; // elementos já adicionados var adicionar =…
-
1
votes1
answer218
viewsA: Add indicator in Materialize CSS tabs
If you want you can do so, put a button with icons leaves it not visible and when the person clicks on the area of tab the button appears for two seconds and then disappears. Then you use media…
-
3
votes2
answers843
viewsA: Lock Radiobutton when selecting another radio button
I’ll post an example: In your case there will be $("#prioridade2, #prioridade3").attr("disabled", true); You don’t need the .not(this); $(document).ready(function(){ $("#prioridade1").on("click",…
-
3
votes2
answers1197
viewsA: It is possible to know that an option has been selected in javascript event
What you’re looking for is the event change jQuery: $("select").on("change", function() { var valor = $(this).val(); // aqui vc pega cada valor selecionado com o this alert("evento disparado e o…
-
0
votes1
answer443
viewsA: Select radio when clicking a button
Matheus there are many ways to do this: If you want something more dynamic in the example below I mark the radio and add the respective name of the button clicked. $(document).ready(function(){…
-
4
votes3
answers199
viewsA: How to make a text look one color, and return to the original?
You can do it this way if you want: var icone = document.querySelector(".fa"); var texto = document.getElementById("foo"); icone.style.color = "green"; // inicializa com o botão verde…
javascriptanswered LeAndrade 8,475 -
1
votes1
answer119
viewsA: Text larger than the button
<div class="card-header" id="headingOne"> <h5 class="mb-0"> <button class="btn btn-link btn-acrd" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true"…
-
1
votes3
answers736
viewsA: jQuery - Field with maximum 4 digits and complete with 0 left
Dude I made an example for you. 1 - You do not need to use the Mask for this because you are already setando maxlenght in Html. 2 - Your code only had one small error, on the line of while to catch…
-
0
votes1
answer492
viewsA: CSS Grid Layout - Browser compatibility
Well, based on this link of the site can i use, it has full support of virtually all major web browsers nowadays, with the exception of IE version 11 that it is necessary to use the prefix -ms- and…
-
1
votes1
answer118
viewsA: Use javascript to fire modal ulkit css
You can do so for example. Every time the number input is greater than 1 the modal will open. Your code didn’t work because you didn’t pass the # in the modal call. Keyup method checks each input…
-
2
votes1
answer950
viewsA: How to put a <div> inside an iframe?
Try to ride with that logic. 1 - Put a id in the paragraph you want to update 2 - In your code you won’t need var in a, for it was only to set the example, not also of log.text(num); 3 - In the var…
-
1
votes3
answers279
viewsA: How to execute an insert only once via javascript/jQuery
See if with the method one help you: $("#btn1").one("click", function(){ // executa apenas uma vez $("#local1").prepend("<p>Qualquer coisa - uma vez</p>"); }) $("#btn2").on("click",…
-
4
votes2
answers242
viewsA: How to leave checked option when clicking div
You can take the id for example of div that was clicked to use its value. $(document).ready(function(){ $(".divs").on("click", function(){ // pega click na div $(".divs").each(function(){ // para…
-
1
votes1
answer258
viewsA: Problem making inputs appear and disappear with jquery
Face if it’s just to show off the contents of div can do as in the example, but, follows some considerations: 1 - If you leave the class d-sm-none on the button as is your code, the button will stay…
-
0
votes3
answers94
viewsA: Change given inside date attribute
If it’s with Vanilla you can do it like this: var teste = document.getElementById('teste'); teste.dataset.delayDuration = 100; console.log(teste.dataset.delayDuration); <span id="teste"…
javascriptanswered LeAndrade 8,475 -
2
votes1
answer37
viewsA: Nav-Bar placing items inside the button
Dude is working normal. Right off the bat right there in your code I could see that you closed the div Collapse navbar-Collapse. And another problem is that you are following a tutorial that is…
twitter-bootstrapanswered LeAndrade 8,475 -
1
votes1
answer483
viewsA: Vertical and horizontal alignment do not work on bootstrap 4 with flexbox
Dude I think you’re messing around, there’s no class flex-items..., Probably what you’re looking for is justify-content-md-center and align-items-md-center. In case the Md is for resolution Média.…
-
0
votes3
answers2026
viewsA: How to change the color of the form button with javascript?
Guy made an example, but it’s worth a few considerations: If you put style on the button, then it doesn’t make much sense the disabled, I suggest leaving instead of orange a heavier color and…
javascriptanswered LeAndrade 8,475 -
1
votes1
answer35
viewsA: How to compare if the div with Event click has a class similar to another div selected?
Can do using hasClass at each tag click event i, for example; $('i').on('click', function() { var icone = $(this); if(icone.hasClass('fa-bicycle') == true){ console.log('Tem a classe'); } else {…
-
5
votes3
answers10051
viewsQ: How to change the background of a CSS-only checkbox?
CSS in width and heigth has an effect, because background-color nay? input{ width: 20px; height: 20px; } input:checked{ background-color: blue; width: 25px; height: 25px; } <input…
-
0
votes1
answer1224
viewsA: Is it possible to place the contents of a "Thymeleaf object" inside a "variable", in HTML?
As inside this input will have a value brought by th:value="${log.content}". You can take the value in several ways, by id, for class, usually with Javascript or jQuery: var valorInput1 =…
-
0
votes1
answer72
viewsA: Start Jquery function when a div receives a class
$(document).ready(function() { $(".modal-load").addClass("ativo"); //adiciona a classe ativo if ($(".modal-load").hasClass('ativo')) { //se foi adicionada executa o loader …
-
1
votes2
answers1295
viewsA: What is the difference between prop and Emit in Vue.js?
A property is a custom attribute for passing information from the parent. A child should explicitly state what it expects to receive using the props option: - Create the template with a h3 and…
-
3
votes1
answer1945
viewsA: Accessing data from a js object
Like the bfavaretto said see the moment you are accessing the data as it may not yet be available, but the syntax is this as in the example. You have an object dice, that to access any of its…
-
1
votes2
answers37
viewsA: Print radio checked in Ulkitcss
Israel did not understand very well the way you used the ng-checked, you still used it along with the checked of HTML, thus probably does not work. The most indicated there would be as in the…
-
1
votes3
answers214
viewsA: How to concatenate input value to function?
Nathan I’m going to post a very simple way for you to understand since you said you don’t know much about Javascript, because the answers given may confuse you a little. function…
javascriptanswered LeAndrade 8,475 -
0
votes1
answer53
viewsQ: Access to property value
I have a method where I need to take the number of each table, but the return is always the length of the property and not its value. If I leave only one table the method correctly returns the value…
-
2
votes1
answer1255
viewsQ: How to remove the row that separates the columns in an html table?
I would like to know how I can remove the row separating the columns from this table. table { font-family: url('../fonts/Lato-Regular.ttf'); border-collapse: collapse; border-radius: 4px; width:…
-
0
votes2
answers66
viewsA: CSS/HTML Writing around an image
Face the example of Hugo already meets you, I made a simpler example, as you said you do not understand CSS, be with only one example with more advanced selectors as in his example, I think it can…
-
0
votes1
answer186
viewsA: I want to import an entire page with jquery, should I divide the page into different jquerys so that I can write code through the jquerys?
Peter then as I said, you already have to bring the import with the right demarcation made with html and css (I don’t know if you’re using frameworks like bootstrap) to position the elements…
-
0
votes1
answer285
viewsA: Problem including JS file in project with Vuejs 2
Simple guy, realized that the script is being called after the tag body. Correct would be: <body><script src="/../rocketstore/dist/js/mais.min.js"></script></body>…
-
1
votes3
answers53
viewsA: How to display the current date while loading the page
Just you put the event onload function and remove the event onclick button. function formataData(data = new Date()){ var dia = data.getDate(); var mes = data.getMonth()+1; var ano =…
-
4
votes4
answers1092
viewsA: Doubt with switch in Javascript
Summarizing a little the answer of Sam, the most indicated there would be the use of a block if-else in place of switch, because then you already make the return according to the value of a…