Posts by Matheus Cristian • 1,045 points
40 posts
-
1
votes3
answers397
viewsA: Footer does not remain at the bottom of the page
You could adopt another structure for your project, follow a suggestion using the functionalities of display: flex;. https://codepen.io/mathues/pen/gEKZaL. In the suggestion I separated the…
-
0
votes1
answer640
viewsA: Automatic refresh only once in PHP
Hello, Gustavo. One solution I see is to use URL parameters along with the function time() of PHP. $show = false; if (isset($_GET['t']) { $time = $_GET['t']; if (time() - $time > 5) { $show =…
-
2
votes1
answer48
viewsA: Error when mouse is moving
Hi, Tomás! Imagining the scenario of the user entering the site, while moving the mouse (not yet called the Hover function setEvent in a div) it will try to access the call variable timeout which…
javascriptanswered Matheus Cristian 1,045 -
1
votes2
answers1166
viewsA: Array to store input values that are inside a li
Good morning, Leandro. I made a little code for you to use as backup: https://codepen.io/mathues/pen/oJJbWO I used the Vue.js framework because it is very simple and easy to use. If you are…
-
0
votes3
answers169
viewsA: Modal doesn’t close on the Electron, how to fix it?
Good night, Alisson! In your code, there is a control word treatment false as if it were a function false();. What could show a mistake like: VM6118:1 Uncaught TypeError: false is not a function Try…
-
0
votes2
answers91
viewsA: Affecting javascript Divs
One thing I realized is that when you use the id to find your reference in Javascript, jQuery -or the browser itself- treats only one element, that is, the first with that id specific. To resolve…
javascriptanswered Matheus Cristian 1,045 -
2
votes2
answers1377
viewsA: Customize input range for progress bar?
I believe you want to do some kind of time control of your video. Taking into account that your code is incomplete and so should be put the video tag. The video tag already comes by default with…
-
4
votes1
answer16827
viewsA: How to open the link in the same tab
Just change your link target. <a href="#" target="_self">Link</a>
htmlanswered Matheus Cristian 1,045 -
0
votes1
answer196
viewsA: Download file to server
Looks for crons, serves for php scripts.... 0,10,20,30,40,50 * * * * /seuarquivophp.php
-
0
votes2
answers72
viewsA: Algorithm that checks whether the sum of any two items of an ordered array is equal to a number yielding wrong results
function pairSum(target, number){ for(var i in target){ for(var j in target){ if(i == j) continue; if(target[i] + target[j] == number)…
-
0
votes1
answer70
viewsA: Multi Field Calculation within a While
From what I understand, you want a calculator? var content = document.querySelector("#content"); for(var i=0;i<10;i++){ (function(){ var div = document.createElement("div"); var input1 =…
javascriptanswered Matheus Cristian 1,045 -
0
votes2
answers998
viewsA: Regular expression, taking values from HTML
var html = document.querySelector("#minhas-tags").innerHTML; var conteudo = []; html.replace(/tag[0-9]*">([a-zA-Z0-9]*)<\/a>/gi, function($1, $2) { conteudo.push($2); }); alert(conteudo);…
-
1
votes1
answer5329
viewsA: How to center a button inside a responsive container?
I think something’s missing because I went to the jsfiddle and bugged. #section{ width:90%; margin:0px auto; } #section .item{ overflow:auto; width:25%; position:relative; float:left; } #section…
-
0
votes2
answers120
viewsA: How do I do css animation?
Well, this was done with javascript, can even open the element inspect and go there on the console. You would have to go out checking if he made mouseover, and mouseout by left by top by right or…
-
0
votes2
answers1447
viewsA: Forward and backward slide Javascript
It is not a good practice to mix the layers this way. I created a script, feel free to use it!!!!.... http://jsfiddle.net/8j362k7d/1/ If you want to put some kind of animation, you can use css: For…
-
1
votes1
answer890
viewsA: Javascript - Return image dimensions
Remember that the initial value of width is null and it will only be assigned at the event onload image. Note that the console.log(width); is out of this event. The ideal would be is inside.…
-
0
votes2
answers83
viewsA: How to deal with <ul>
This is very messy! Why use a ul logo and menu? First understand what the ul to know if it is necessary to use in this context!!!! The upload image: #upload{ background:#006; width:500px;…
-
1
votes1
answer1041
viewsA: Edit txt file remotely
In that case I’ll create a file: editar.php <?php $pagina = "buysingle.html"; if(isset($_POST)){ if($_POST["conteudo"]){ $fopen = fopen($pagina,"w+"); fwrite($fopen,$_POST["conteudo"]);…
-
0
votes1
answer42
viewsA: Add title mouse
It will not run in jsfiddle, as the path http://jsfiddle.net/tttxfvcu/3/js/raphael.js there is no. On the left side of jsfiddle there is the option to add predefined frameworks.…
javascriptanswered Matheus Cristian 1,045 -
0
votes2
answers786
viewsA: How to update the canvas?
To erase you use the context.clearRect(width,height);, to draw you use the context.drawImage(imagem,x,y);.
-
3
votes2
answers3128
viewsA: Angularjs - accents
It must be the encoding of your file, try to change it to utf-8. Or you can add direct html inside the head tag: <head> .... <meta charset="utf-8"/> .... </head>…
-
0
votes2
answers60
viewsA: stickyfloat.js can’t apply together to php pages
Change that: <script> $('.menu').stickyfloat({}) $('.menu2').stickyfloat('update',{ duration:0 }); </script'> for: <script> window.onload=function(){ $('.menu').stickyfloat({})…
-
2
votes4
answers1027
viewsA: How to set a value in an input tag of another site?
As has been said, if the other site is not yours, it is complicated, but some sites make it available in a simple way, by the url.... https://www.google.com/search?q=valor…
-
1
votes6
answers96354
viewsA: How to make an "Alert" in PHP?
Try this: mail($email,$assunto,$mens,$headers); header("location:javascript:alert(\"Email enviado com Sucesso!\");location.href=\"index.php\";"); And analyzing your code, I realized that you want to…
-
3
votes4
answers22158
viewsA: How to add row spacing to a table?
A solution put a "separator" of lines.... td{ border:1px solid #000000; } table tr[class=separar]{ display:block; margin-bottom:8px; } <table cellspacing="0" cellpadding="0"> <tr>…
-
2
votes1
answer395
viewsA: URL redirection Google extension
I think it helps you: var padrao = /^(http:\/\/|https:\/\/)?(www\.)?google\.com(\/)?$/g; var url = "http://google.com/"; if (padrao.test(window.document.location.href)) {…
-
1
votes1
answer159
viewsA: Help with basic Javascript (timers)
Is it even worth using php and having to update the page to generate other random numbers? You can simply use Math.Random() from javascript for this, this function generates a random number between…
-
1
votes2
answers152
viewsA: Bilingual site with JS
I created a function for you that is: http://jsfiddle.net/3ywm7Lyq/ Instead of using cookie I used localStorage, you can change the default language value in line 2 of the javascript code....…
-
0
votes2
answers3254
viewsA: Resizing image with canvas and Javascript
There is an error in your code, as you take the image that is on the canvas without before drawing it? var img2 = new Image(); img2.src = canvas.toDataURL("image/jpeg", 1.0); //Exibe (desenha) a…
-
0
votes1
answer1615
viewsA: Generate image dynamically by url
I’m not there these things in php, but I know there is GD (http://php.net/manual/en/ref.image.php) in php Creating image dynamically through get method (?width=300&height=300): File: image.php…
-
0
votes2
answers257
viewsA: Restrict object method override in javascript
'Cause when you do: $('body').html = null $('body').html() You are calling the $ function separately so will always return a separate object.
-
1
votes0
answers95
viewsQ: Function names in php, how to memorize them?
I’ve tried to remember the name of several functions in php for a long time, but there’s no way, I forget everything. "This function is all together or has an underline?" Examples: ucfirst ou…
phpasked Matheus Cristian 1,045 -
3
votes2
answers2104
viewsA: How to put an image in front of a button?
The image is outside the form and how form is a block then the image has to be inside the tag form, try to put the tag img within the form and add your css: #newsletter-wrap img{ display:block;…
cssanswered Matheus Cristian 1,045 -
2
votes2
answers72
viewsA: How to display alert after Eval() error?
Would that be?.... try{ eval("5 + [preco da bola]"); }catch(e){ console.log(e); }
-
3
votes3
answers656
viewsA: What is the best way to convert HTML entities with Javascript?
I don’t quite understand but what you’re trying to do is turn html into text and text into html? because if it is you have this way using replace. var string="<div>oi</div>";…
-
0
votes2
answers1288
viewsA: How do I make the file sending field invisible?
I found a simple and interesting way to take this part, or rather, hide. http://codepen.io/nec/pen/dxfcn It puts opacity 0 on this input to make that part invisible.…
-
5
votes2
answers45048
viewsA: Create dynamic JS table to use in HTML
I created this function for you, if you want to use it. function criarTabela(conteudo) { var tabela = document.createElement("table"); var thead = document.createElement("thead"); var…
-
1
votes1
answer1479
viewsQ: What is the difference between "~/" and ".. /" for directory navigation?
I saw it somewhere, I wanted to know the difference.
-
34
votes1
answer58531
viewsA: Remove accents from a php string
$string="olá à mim! ñ"; function tirarAcentos($string){ return…
-
1
votes2
answers1679
viewsA: remaining characters textarea
You could just use the property maxlength that already makes this limit for you. var textarea=document.getElementById("textarea"); var…