Posts by LeAndrade • 8,475 points
404 posts
-
0
votes3
answers65
viewsA: Link that opens the "content" in the next div
I made a very basic example using jQuery. As the example of Sam will already serve you if you use Vanilla, if you choose jQuery, I think by example, it’s easy to implemete as well. OBS: As the Sam…
-
0
votes1
answer400
viewsA: How to calculate and display the result of an operation, taking the data from a form, and sending the answer on the same page below the form?
Your code lacked some things like taking the value of what is being typed and turning the value into number type. function mostraResultado(){ var form = document.getElementById("form"); // acho que…
-
0
votes1
answer322
viewsA: Load tab only by clicking (with jquery)
Face is basically what is in the example. In TAB 1 you load the content on the same page, on the other tabs, you load a different html for each one. $(document).ready(function() { $("#tabs").tabs({…
-
1
votes3
answers53
viewsA: How not to enable inherited js function?
Hugo’s answer already serves you, but I leave here a solution only with js: $(".collapsible").collapsible(); $("a").on("click", function(e) { e.stopPropagation(); console.log("Outra função aqui");…
-
0
votes1
answer649
viewsA: Change a JS Function to open two different Modal Bootstrap Windows - Asp.Net Core MVC
I made an example for you very simple of one of the ways to exchange a class of the same element with jQuery. To see the difference in modal size click on whole page. $(document).ready(function() {…
-
0
votes2
answers231
viewsA: Animation zoomIn is flashing with mouseenter
Andrew’s answer is perfect, really solves the problem, I leave an alternative here if you choose not to use an entire library with effects that can be performed easily (even with more visual…
-
1
votes2
answers185
viewsQ: What is the purpose of defining the name of a function that is assigned to a variable?
I was taking a look at some posts here on the site and I came across this question here. Well, the accepted answer explained the statement of expression of functions, anonymous, named and…
javascriptasked LeAndrade 8,475 -
0
votes1
answer414
viewsQ: Prompt Javascript
The return of prompt is by default String correct? The function Number does the prompt return conversion which is String to number. Pq then when I run the following function and place numbers…
javascriptasked LeAndrade 8,475 -
8
votes4
answers418
viewsQ: Is there a difference in using HTML5 attributes with or without true/false?
There is a possibility of some kind of problem in the code when I do not assign a boolean value to the attributes disabled, readonly or required? I’m working with Java in the back end and the IDE…
-
5
votes4
answers5024
viewsA: How to disable field with Javascript?
I think you must have gotten lost when you tried to mix like I said Vanilla with jQuery. function HTeclado() { if ($("#cbHabilitarTeclado").prop('checked') == true) {…
-
0
votes1
answer51
viewsA: Dropdown button does not work inside a div
Man the problem that’s occurring there is that your button is inside a div and the content of dropdown out of the div. <link rel="stylesheet"…
-
10
votes2
answers3690
viewsA: Regex to capture words between two characters
':(.*?):', 'g') - This expression basically means: . takes everything on the same line, * finds 0 or more occurrences in the text, ? Find the first character or the following characters. 'g' returns…
-
1
votes1
answer67
viewsA: Javascript em Imagem
I made an example and it’s working, it turns out that in your code there are some errors: Failure to lock your keys keyframes. Lack of closure of div in html. It is not very suitable to use margin…
-
0
votes2
answers81
viewsA: HTML preview showing the first element
This is why you’re giving replace, but inserting the character again, so it shows the first one. You have to leave it empty, so that the characters do not appear: The regular expression: /</g…
-
2
votes1
answer36
viewsA: Problem when displaying images and icon on website
WRONG: <link rel="icon" href"logogarrah.png"> CORRECT: <link rel="icon" href="logogarrah.png"> WRONG: <ing src="logogarrah.png" alt="logo garrah"></ing> CORRECT: <img…
-
3
votes2
answers797
viewsA: Aid balloon/information
If you are using bootstrap follow the reply of Netinho Santos, if not using can create and stylize with CSS even. p { text-align: center; margin-top: 50px; font-size: 30px; font-weight: bold; }…
-
1
votes1
answer53
viewsA: Target page with option already selected
Simple enough, you put the attribute Selected option you want to select. <select class="text" id="assunto"> <option>Selecione o assunto desejado</option> <option id="sugestoes"…
-
1
votes2
answers1031
viewsA: How to create a panel that Displays/Hides fields using Html/Bootstap/Javascript
One of the ways to do it is by using jQuery in a simple way with the method toggle. $(document).ready(function() { $(".divOculta").hide(); $("#btnPesquisaAvancada").on("click", function() {…
-
0
votes4
answers102
viewsA: Problems with click jquery
Here in the example I made it worked: Just change your code $(Document). on('click', '.book', Function() for $(".book"). on('click', Function() var livros = [ { "abbrev": "hob", "chapters": [ […
-
1
votes3
answers96
viewsA: How to change label type within a table depending on what is inserted
If you want to do with jQuery can do so: $(document).ready(function() { var texto = $("span").text(); //aqui vc pega o texto if(texto == "Bola"){ $("span").attr("class","label-secondary"); //aqui vc…
-
0
votes1
answer33
viewsQ: How not to present in html the keys of a vector in VUE.js application
I’m playing a simple application with Vue.js, when checking some checkbox the options marked are shown in Html, until then it works normal, only the problem is that the brackets of the vector keep…
-
0
votes1
answer34
viewsA: Problems with scrolling href to content on the same page in smaller resolutions
Strange here on the site is working perfectly. $('a.scroll-to').on('click', function() { $('html,body').animate({ scrollTop: ($($(this).attr('href')).offset().top - 0) }, 600); }); #saibamais{…
-
1
votes2
answers92
viewsA: Is there any way to format an entire row while finding word on page
Dude I made an example here, just to give you an idea, until pq I did not understand very well where are the paragraphs that you do the match. I used the method includes() to look for the occurrence…
-
1
votes1
answer110
viewsA: Show div after jquery validation
Man I made an example here, I changed some things in the js. OBS: I suggest you do as the friend Netinho Santos said and use a plugin to validate the form, which saves time.…
-
0
votes1
answer47
viewsA: Prototypes in Javascript
To learn more about read here and here. var carro = {}; carro.modelo = 'Celta'; carro.marca = 'Chevrolet'; console.log(carro.hasOwnProperty('modelo')); // retorna um boolean indicando se o objeto…
javascriptanswered LeAndrade 8,475 -
1
votes1
answer57
viewsA: Collapse by not hiding
Guy missed closing the tag div like Tony said, make sure you imported all the files needed for the operation. follow your code working: <link…
-
0
votes2
answers190
viewsA: HTML Select (active disabled attribute) - How to display a message when mouseover is triggered?
Dude I made an example here just made with CSS, I don’t know how the project is going there, if I needed the mouseover for other things, but if I could use the :Hover CSS follows the example.…
-
3
votes3
answers1608
viewsA: How to make Confirm custom?
There’s this other version here also. swal({ title: 'Salvar', text: "Para salvar clique em Ok!", type: 'info', showCancelButton: true, confirmButtonColor: '#28B463', cancelButtonColor: '#d33',…
-
0
votes0
answers35
viewsQ: What is the output of wysiwyg plugins like Summernote and Tinymce?
Someone would know me what is the output of this editors type Summernote, Tinymce, Froala, Ckeditor4. I looked at the documentation of all these and did not understand for example how to save the…
javascriptasked LeAndrade 8,475 -
2
votes2
answers1296
viewsA: How to create a cool color input?
Only CSS makes it cool too. #cor { height: 35px; border: none; padding: 0; background-color: #fff; cursor: pointer; } #cor:focus{ box-shadow: 0 0 0 0; border: 0 none; outline: 0; } <label…
-
0
votes1
answer534
viewsQ: How do I export the values of a form to PDF with the jsPDF plugin?
I am working on a project that needs to turn a page HTML in an archive PDF. I’m using the plugin jsPDF. There are many examples of how to turn htmls into pdf, "but", all examples I’ve seen use only…
-
1
votes1
answer50
viewsA: How to play an input values in a div?
I made a simple and easy little example so you can understand. OBS1: The event keyup occurs every time the input receives information, either adding a character or removing it. It shows in the div…
-
0
votes1
answer170
viewsA: Move the image to the right side of the screen
As you are using bootstrap just change the class container for container-Fluid. .apresentacao { background-color: #E6E6FA; border-top: 3px solid #B0C4DE; padding: 50px 0; color: #000; }…
-
0
votes1
answer126
viewsA: How to Add an "overflow:scroll;" on the side of an extended datalist
Nothing friend you try in a matter of CSS will work with this element, as each browser defines its own style for this type of element. See in the CSS code the commented parts. .bt{…
-
1
votes2
answers897
viewsA: <br> is obsolete?
As you can see in the example with the use of br vc has no control over the spacing of the elements as vc has using div for example, that gives easily to you control by CSS. div { padding: 50px; }…
-
0
votes2
answers3003
viewsA: How to make the HTML page fit the window size
I made an example basic and minimum, I hope it helps you in your search. It also follows some considerations: 1- This theme is too broad to be discussed in just one example. You can get much more…
-
1
votes1
answer166
viewsA: event with javascript scroll
There are errors in your code: first - I don’t know where you got this link to the library, but here it didn’t work. I used this other here. 2nd - You have to load them first CSS then the JS, the…
-
2
votes4
answers704
viewsA: How to add a new style to an html element?
$(document).ready(function() { $("span:first").on("click", function() { $("b").css("display","none"); }) }) .cifra.mono, .cifra.mono pre { font: 12pt 'Roboto Mono', monospace; } .c_config span {…
-
2
votes2
answers2021
viewsA: How to check whether elements of an array are contained in another Jquery array
As I did: 1 - I traversed one of the vectors with the loop for. 2 - Then already with the values, using the javascript method includes made the condition to test if the values of one vector already…
-
0
votes6
answers6079
viewsA: My function that returns a true/false boolean if it exists or not, is that correct?
Another easy way to do it: function Habilidade(){ if(skill.includes('javascript')) { console.log(true); } else { console.log(false); } } var skill = ['javascript', 'reactjs', 'React native']; var…
javascriptanswered LeAndrade 8,475 -
0
votes5
answers889
viewsA: Automatically delete inputs later
As your inputs are only of the type text, try like this: $('#myForm input[type=text]').val("");
-
0
votes1
answer20
viewsA: Verify user
var perfil = document.querySelector('#perfil').textContent; if (perfil == '') { //seu erro está aqui vc está usando atribuição e não comparação window.location.assign("../index.php"); }…
javascriptanswered LeAndrade 8,475 -
1
votes1
answer220
viewsA: Bootstrap - Update only one div (Menu)
You can use the method load() jQuery. Html: <!-- content --> <div class="content"> </div> jQuery: $(document).ready(function() { $("ul li:first").on("click", function() { //…
-
1
votes1
answer49
viewsA: how to create output event in JS click
It’s because you need to put one condition, otherwise there is no way to know the state of the element whether it is visible or not. let sidebar = document.querySelector('.sidebar-page'); let…
-
0
votes1
answer53
viewsA: E-mail validation using Id and show
I made an example for you to test: $(document).ready(function() { var valida = "[email protected]"; // texto só para validar a condição $(".fa-check").hide(); $(".fa-times").hide();…
-
1
votes1
answer55
viewsA: Comparing fields from a form
See example working: function comparaDataAno() { var ano_licenca = document.getElementById("ano_licenca").value; var data_emissao = document.getElementById("data_emissao").value; var data =…
javascriptanswered LeAndrade 8,475 -
-4
votes2
answers95
viewsA: Return the number of characters in a word list with Typescript
//Cria lista de palavras var caracteres:string[] = new Array("Celular","Carro","Pessoa"); var total = caracteres.toString(); function quantidadeCaracteres( a, b ){ return a + b; } console.log(…
-
1
votes2
answers47
viewsA: Enable inputs as filling
Man I made an example here, see if this helps you: $(document).ready(function() { $("#list-lugar").on("blur", function() { $(".form-group:eq(1)").removeAttr("hidden"); }) $("#add-periodo-t,…
-
0
votes1
answer163
viewsA: How do I put a scrollbar on the materialize card?
Limit the height of the card with classes de tamanho, class small for the card to have a maximum size of 300px, the class medium for the card to have a maximum size of 400px or the class large for…
materializeanswered LeAndrade 8,475 -
1
votes1
answer155
viewsA: Limit tags in bootstrap-tagsinput v0.8.0
The working example $('#palavras_chave').tagsinput({ maxTags: 3 }) $('#marcas').tagsinput({ maxTags: 4 }) <link…