Posts by Murilo Melo • 2,272 points
151 posts
-
0
votes1
answer51
viewsQ: Error-free JS animation on console, but does not work
Well, I am creating an animation of the Tank of the classic Metal Slug, however, when creating the function and executing it to animate the tank, nothing happens. What’s wrong, and how can I fix it?…
-
3
votes2
answers4105
viewsQ: .addeventlistener() is not a function
I’m building a script for modals, but an unexpected error happened, the console says: Uncaught Typeerror: loginBtn.addeventlistener is not a Function`", "at modaisGeral (index.html:233)" and "at…
-
0
votes2
answers100
viewsQ: Click detection and value collection
I am developing a basic calculator to learn a little more javascript, however, I soon came to doubt. How do I go through all the li’s and get their values individually within the array, how do I…
-
0
votes1
answer302
viewsQ: Close element when clicking any other part of page
When the event is triggered, the element opens, but after that it does not close. How can I do so when clicking outside the "infoValor" the tooltype closes? function formTips(){ var…
-
1
votes2
answers109
viewsQ: .onscroll is only read once
I’m having some problems with a function .onscroll: window.onscroll=function(){ if(document.documentElement.scrollTop>5){ menuPrincipal.style.backgroundColor = "rgba(0,0,0,1)"; }else{…
-
0
votes1
answer28
viewsQ: Selecting disabled elements
I need to differentiate the view from a select box where there is an element selected by default, but it cannot be selected by the user (as if it were a placeholder of a normal input), but I want to…
-
0
votes1
answer52
viewsQ: Flex display and width of child elements not working
I am developing a form, however, an error occurred on the page, the elements stay with a margin until the end of the width of the parent div, even if setting a margin 0 and a width less than 50%…
-
1
votes1
answer395
viewsQ: Detect event click out of element
I’m learning how to make tooltips, I even played some previous questions here in the OS, but I came up with a new question; When I click off the element that has the tooltip, it could close the…
-
1
votes1
answer135
viewsQ: Tooltip function does not work when running a second time
I’m creating a tooltips sketch, so that when you click on a certain span, this span shows a message HTML <div class="banner-tooltips" id="banner-tooltips"> <span…
-
0
votes1
answer27
viewsQ: Detecting click elements of an array
If I own a div with id="banner-tooltips", and within it I have n <span> tags declared in variables with javascript, how I can detect the individual click on these span tags ? var caixaTooltips…
-
0
votes1
answer316
viewsQ: Problems with the time interval on a carousel
Well, I’m having some problems with a self-made carousel, more specifically in the transition order of the items. var carouselBannerHolder = document.getElementById("banners-slider"); var…
-
0
votes1
answer27
viewsQ: Reversing the process of a function
I was thinking about a project for testing Skills, about a load bar and I thought, we can undo a modification on a page normally, but and do the opposite process ? for example, we have an automatic…
-
0
votes1
answer28
viewsQ: Capturing elements by tag and inserting into an array
Well, I’m riding a carousel on a test project, and I came up with a question, how can I, with vanillaJS, capture certain elements by tag, and put them inside a array ? The idea would be more…
-
7
votes1
answer443
viewsQ: Some of the real solutions to render lock error and improve performance
Well, lately I’ve seen, in articles about performance, some Angouts, and also in groups on social networks, about such a "blocking of rendering content above the edge". But what is this mistake ?…
-
12
votes1
answer443
viewsA: Some of the real solutions to render lock error and improve performance
Well, first of all, after a lot of research, some crucial points I found were: Do not separate your CSS by components (header.css, footer.css, body.css, grid.css, gallery.css); Avoid using…
-
1
votes2
answers59
viewsA: Error in function for load bar using a while(){}
Well, after a while trying, I was able to solve the problem, I marked the answer of @Arturtrapp as the right one, because it gave me the right direction to solve the problem. Well, the code was…
-
0
votes2
answers59
viewsQ: Error in function for load bar using a while(){}
I’m trying to set up a charging bar that starts after 2 seconds of loading the document, Her every 100 thousandths of a second win 1% of width. However, when the page loads, console.log() shows that…
-
0
votes1
answer119
viewsQ: Dynamic change in an element when resizing the window
$(document).ready(function(){ var heightJanela = $(window).height() + "px"; $("#banner-hold").css("height",heightJanela); }); I performed the above code, so that when the document is loaded, the div…
-
0
votes1
answer215
viewsQ: Sizes of Divs ( Width and Height ) with Relative and/or Absolute positions
I’m having trouble positioning items (div's), in the case, I need the first div, occupy all the height and width of the screen, already the others, occupy only the padding which they receive and the…
-
1
votes1
answer507
viewsQ: String binding of SQL tables instead of id
Data from user accounts id nome sobrenome pais estado cidade telefone url_perfil Login data of users id email senha prioridade My doubts are: How can I link them to foreign key using string ? It is…
-
2
votes2
answers43
viewsQ: Problem with '.data()' and its value within an if
I’m creating some If's not to lose the habit of using them, but when trying something a little different from what I usually do, an error occurs, the if does not work. How can I fix ? I tried in the…
-
1
votes2
answers126
viewsQ: Selecting attributes from Bootstrap
Well, I’m having trouble selecting an attribute from a certain element of bootstrap with the jquery, for example: <ol class="carousel-indicators"> <li data-target="#carrossel-principal"…
-
1
votes1
answer69
viewsQ: Problems with IF loop
I’m having trouble creating a bond if in the jquery so that when the carousel runs the function carousel() he makes a noose if, the problem is, it only runs once the if, and then stops performing…
-
0
votes2
answers57
viewsQ: Placing classes in elements according to the URI passed
Well, I have the following code: <body> <?php $server = $_SERVER['SERVER_NAME']; $endereco = $_SERVER ['REQUEST_URI']; ?> <!-- Menu principal --> <nav class="navbar…
-
0
votes1
answer75
viewsQ: changing the css of the pseudo classes of elements with jquery is possible?
I’m doing some tests with jquery and, came to me the following question: It is possible to manipulate the pseudo class elements css with the jquery? $('#login_1').click(function(event){…
-
2
votes4
answers994
viewsA: Why does Input Type Email validation accept pointless domains?
This is because the input of type="email" accepts any text typed within you with the sole condition of owning [email]@[domínio] in its value. To circumvent this and have a better validation on the…
-
2
votes1
answer2250
viewsQ: Transition into elements using :Hover:after
How can I apply a transition, for example in a background:linear-gradient(to top, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 40%) without hover and background:linear-gradient(to top, rgba(0,0,0,.8) 0%,…
-
2
votes3
answers2535
viewsA: Script para enviar email
I think it would be something like this: PHP <?php session_start(); $nome = $_POST["/*Nome aqui*/"]; $email = $_POST["/*Email aqui*/"]; $mensagem = $_POST["/*Mensagem aqui*/"]; $headers .=…
-
1
votes2
answers100
viewsQ: Error capturing checked attribute
JQUERY $('#caption-item-1').click(function(){ if($('#boleto-input').checked == true){ $('doacao-proximo-1').css({'display':'inline-block'}); }else{ $('doacao-proximo-1').css({'display':'none'}); }…
-
1
votes2
answers202
viewsQ: Event conflict with jquery
I have the following code: $('#abre-busca').click(function(event){ event.preventDefault(); $('#menu-principal-sub li').css({'opacity':0}); setTimeout(function(){ $('#menu-principal-sub…
-
0
votes1
answer868
viewsQ: How to do an action in jquery wait for another to finish to start?
I am trying to create a menu where the search bar appears only after the li's of the menu vanish, for that, I recommended the function .delay() of jquery, but I am not able to realize these effects,…
-
-1
votes1
answer1276
viewsQ: Turbineing the bootstrap Carousel
To add own events on Carousel of bootstrap, use the function $('#myCarousel').on('slide.bs.carousel', function () { }) I wonder, how can I make the text receive or lose opacidade according to the…
-
0
votes2
answers520
viewsQ: Taking the total in pixels of an element passed in variable in percentage
I’m riding a div which must be an exact square, but this square must be based on the square itself width that is being set up with pocentagem (%), but need the total value in pixels. EX: 5% = 105px…
-
0
votes1
answer457
viewsQ: Pass variables in Jquery . css()
I’m having trouble with the following code: //Desktop = D var posicaoMenuD = $('#desktop-menu').position().top(); $(document).scroll(function(){//Alscutador de scroll da página var posicaoScrollD =…
-
4
votes5
answers14273
viewsA: How to put a colored layer over an image?
Just use the properties :before or :after, in case, it would be better to :after for example, your code would look like this: CSS span{ position:relative; } div{ width: 640px; height: 640px;…
-
3
votes2
answers99
viewsQ: Images in Divs
I have a question about divs with imagens in the case, the doubt is as follows: If I have a div, with 400x400, how do I make an image with 200x400 (or other resolution) fit by occupying the total…
-
3
votes1
answer243
viewsQ: Creation of CSS Gallery
I’m trying to create a gallery that I believe is simple, but it’s giving me a lot of work and I’m not able to do it. I would like to know how I can do it and if you have any tips or useful…
-
3
votes3
answers449
viewsQ: Alignment of text vertically
I’m trying to align the text to the center of the screen, I tried to use the transform:translateY(-50%) with the top:50% in position:absolute, but it didn’t work, I’d like to know how to fix it, and…
-
0
votes1
answer52
viewsQ: Items do not exchange classes, attributes or styles
I’m doing some tests in javascript, so that, at the clicar in a given botão, one item summed, in another botão another item sum up, and so on, but none of the botões works *They all follow the…
-
3
votes3
answers350
viewsQ: Selecting src from an input using ID in Jquery
if(!$("#src-img[src='']")){ }else{ }; I would like to know what is wrong with this if selection, in which case I want, if a value is set in the src attribute, it to execute if, otherwise Else.…
-
-1
votes1
answer81
viewsQ: Use of flex in sub-items with different parent elements
I’m using the flex to align all the items equally, however, the sub-items of each of them do not align equally, I used the stretch to align and gain the size according to the largest, but I don’t…
-
4
votes2
answers355
viewsQ: Foreign Key does not respect referential integrity
I’m trying to put together tables and add one chave estrangeira, for example, a shopping list has referência of id from the buyers' table. I did it this way: alter table compras add foreign key…
-
2
votes2
answers520
viewsQ: encoding php to mysql database
Well, I have a problem with encode when throwing dice on a table mysql for php, my page is with encode utf-8, my bank using latin1, however, I do not know how I do such a conversion, if I change the…
-
5
votes2
answers894
viewsQ: Upload/upload images with php
Form <label>Imagem do produto:</label> <input type="file" name="imagem-produto"> Script $foto = $_POST["imagem-produto"]; $tamanhoMax = 1024 * 1024; # 1MB if…
phpasked Murilo Melo 2,272 -
0
votes1
answer120
viewsQ: Header() redirect error
<?php require_once("banco-produtos.php"); require_once("logicaUsuario.php"); verificaUsuario(); require_once("header.php"); $id = $_POST['id']; removeProduto($conexao, $id); $_SESSION["success"]…
-
0
votes1
answer103
viewsQ: Error displaying alerts with $_SESSION[""]
I’m running a test site to train a little bit of php, am using $_SESSION[""] to show alerts, however, when climbing to a servidor non-local alerts stop working. PROJECT LINK->…
-
-1
votes1
answer511
viewsQ: PHP Mailer - Undefined Method 'Subject'
send-contact.php <?php session_start(); $nome = $_POST["nome-contato"]; $email = $_POST["email-contato"]; $mensagem = $_POST["mensagem-contato"]; require_once("mailer/mail-autoloader.php"); $mail…
-
3
votes1
answer818
viewsQ: Capturing the Boolean value of a PHP checkbox
I am making a product form, where the user needs to inform if the product is used or not, however I am having difficulties in capturing the value of this checkbox, if it is 1 or 0, in the mysql the…
-
0
votes1
answer595
viewsQ: $_SESSION["Danger/Success"] in php to display alerts
logicaUsuario.php <?php session_start(); function usuarioEstaLogado(){ return isset($_SESSION["usuario_logado"]); }; function verificaUsuario(){ if (!usuarioEstaLogado()){ $_SESSION["danger"] =…
-
3
votes4
answers857
viewsQ: Compare if variable is number within an if
Having var chute = Math.round(parseInt(prompt("Adivinhe em qual número estou pensando"))); var numeroPensado = Math.round(Math.random() * 100); if(chute != numeroPensado){ document.write("Que pena,…