Posts by Samir Braga • 10,016 points
275 posts
-
3
votes1
answer70
viewsA: Array items related to adding new item
Use the method unshift inserting a new value at the beginning of the array: var array_exemplo = ["item_1", "item_2", "item_3", "item_4", "item_5", "item_6", "item_7", "item_8", "item_9", "item_10"];…
-
2
votes1
answer1285
viewsA: Display input based on a select option
Add a class to all input. Then just put a hide() in class and so in the group and a show() for id in the specific element: $('.select').on({change: listChildren}).trigger('change'); function…
-
2
votes2
answers1986
viewsA: Diagonal matrix in java
I’m not an expert in java, but I figured that might help you, add this to your code: int D = 0; // soma dos números da diangonal 2 for (i=0; i<N; i++) { D += m[i][i]; } int d = 0; // somas dos…
-
1
votes3
answers1165
viewsA: Problem leaving automatic field width in responsive layout
Look at this example where I use a table to achieve your goal: table{ width: 100%; } td{ border: 0; padding: 0 5px 0 5px; margin: 0 5px 0 5px; } input[type="submit"], input[type="text"] { width:…
-
4
votes1
answer64
viewsA: How to delete a term inserted in a form using jQuery?
Try this: var $tag, $status,$msg; if ($("main .container .busca input").val() !== "") { $("main .container .busca p").text(""); $status = ("<p>" + $(".busca input").val() + "</p>"); $tag…
-
5
votes1
answer84
viewsA: How to load a plugin according to the width of the screen?
Vinicius, here’s an answer that might work: <script> function verifySize(){ var largura = window.innerWidth; // Cria a tag script script = document.createElement("SCRIPT"); if(largura >…
javascriptanswered Samir Braga 10,016 -
2
votes1
answer7397
viewsA: Placing scroll in a table so that it does not cross the limits of the window size
This can be done through the css property overflow. To div where your table is must own these property max-width: 100%; overflow: scroll As in this example:…
-
8
votes3
answers170
viewsQ: Create markup with predefined symbols
I didn’t know how to pick a specific title before my doubt, so it was that vague medium anyway. I’ve been trying to do the following for a while: Assuming I have the <p>: <p>Olá, $está…
-
0
votes4
answers9290
viewsA: How to place a gif before displaying the site page
There is an option on JQuery very simple. Using the examples already cited: JQUERY $(document).ready(function() { setTimeout(' $("#preload").fadeOut(100); ', 1500); }); When the page is completely…
-
3
votes2
answers910
viewsA: Count the amount of characters changed in an input field
Well, I did an example on Jsfiddle: http://jsfiddle.net/SamirChaves/y41q39yd/4/ You will notice that there are two text boxes. Basically, the system will check if there is a difference greater than…
-
1
votes2
answers1089
viewsA: how to leave rectangular image?
Well Alexsander, this can be done in a very simple way, through the property background of css. For example: <div class="noticia"></div> <style> .noticia{ width: 300px; height:…
-
4
votes1
answer134
viewsQ: How to create a "load" until the function is fully executed?
Hello. To get to the point: assuming that I have a function with repetition structures that, depending on what the user fills, the existing process in this function can take some time, and while it…
-
1
votes1
answer299
viewsQ: Problem when aligning Footer
Hello, I have a problem that is disturbing for a long time, I have a page on which there is a div which has several contents inside which are modified according to the user’s wish, below there is a…
-
0
votes2
answers648
viewsA: How to increase the height in a lively way?
I noticed that in your example when climbing the scroll bar the size of the div does not follow as it happens when going down the scrollbar, so I rang, I do not know if this is what I wanted, but I…
jqueryanswered Samir Braga 10,016 -
3
votes1
answer38
viewsQ: Is it possible to configure a Jquery Effect?
It is possible to change the options on Toggle Explode? For example: it has nine divisions by default, is it possible to modify the number of parts in which it explodes and the size of these parts?…
-
1
votes1
answer176
viewsQ: Measure distance between SVG polygon points
I created a SVG very simple with a triangle. <svg class="triangulo" height="210" width="500"> <polygon points="200,10 250,190 160,210" style="fill:lime;stroke:purple;stroke-width:1" />…
-
5
votes4
answers28473
viewsQ: Align text after image
Hello, I have a problem I don’t know how to solve. This is my situation: But I want it to stay this way: And like I said, I have no idea how to fix. And that’s my code: <div style=" position:…
-
1
votes1
answer82
viewsQ: Zoom and drag settings in SVG area
I’m trying to make a system creates a graph of a mathematical function, and I’m developing it into svg. But I’m encountering some difficulties, the first of which is the lack of automation, because…
-
7
votes2
answers917
viewsQ: Check if parenthesis has been closed
I need a Regex to check inside the string, the parenthesis has been closed. This is my example: /regex/.test("fdfdfdf(ddsd"); //retorna false, porque o parentese nao foi fechado;.…
-
4
votes3
answers3924
viewsA: Insert external video or HTML or JS into a div
Can this help you? If in doubt please let me know. To see the result click here . HTML <div id="video" class="UJAwNkhbYWM"> <iframe width="854" height="510" id="caixa" frameborder="0"…
-
10
votes2
answers6234
viewsQ: How to check if a number is decimal?
Is there any way to know if a number is decimal, ie if it contains "comma"?; One code I found was this: Html <input type="text" onblur="isNumber(this.value)" id="text" /> Javascript function…
javascriptasked Samir Braga 10,016 -
11
votes3
answers2648
viewsQ: Automatic calculation in text box
Good morning. Is there any way when the user type this in a text box: A script runs the account automatically and results, in this case=1 ? It is also important that it does this with all operations…
-
1
votes1
answer1645
viewsQ: Validating text box
Whenever I do a javascript validation of a text box, to know if it is empty or not, I do it as follows: function validar(){ var input = document.getElementById("texto"); if(input.value == ""){…
-
3
votes3
answers152
viewsQ: Css alignments
My case is this:: But I want to leave it at that: HTML <div id="problema"> <div id="verificar" style="width: 500px; height: 100px;"> <h1 style=" clear: both;position: relative;…
-
5
votes1
answer2122
viewsQ: Capture actions: Scroll Down and Scroll Up
Is there any way in jQuery to capture the events of "Scrolldown" and "Scrollup"? I tried this way: var lastScrollTop = 0; $(window).scroll(function(event){ var st = $(this).scrollTop(); if (st >…
-
2
votes1
answer1972
viewsQ: How to know the number of "children" of a class?
For example, using a for: var children = numero_de_filhos_de_uma_classe_qualquer; for (i = 0; i <= (children); i++){ document.getElementsByClassName("classe")[i]; } HTML <div class="classe"…
-
4
votes1
answer229
viewsQ: How to apply a function to multiple objects? (Pure Javascript)
For example, I have a div within a variable obj obj = document.getElementById("objeto"); ..I want a function to be applied to it that way window.onload = function(){ window.onclick = function (){…
-
2
votes1
answer524
viewsQ: setInterval javascript does not work
The following code works as the setTimeout function (happening only once and not repeating), I have tried several ways and could not, if anyone can help me, already thank. function girar(){ var bola…
-
4
votes1
answer1102
viewsQ: How to give Play/Pause in a SWF contained in an HTML?
My HTML is like this: <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550" height="440" id="movie" align=""> <param name="movie" value="swf-file.swf"> <param…
-
3
votes2
answers2845
viewsA: @CSS font-face installs the font on the computer or just uses it on the website?
The value local() causes the browser to search for the font on the visitor’s computer before downloading the one on the server. But by my knowledge it does not download, if you pick one of google…
-
2
votes2
answers3896
viewsA: Changing the color of a HTML5 <Progress> element
After a good search, really good, I found a solution. To the value of the bar just add to the css: #progresss::-webkit-progress-value { background: -webkit-linear-gradient(top, #7db9e8 0%,#1e5799…
-
2
votes2
answers3896
viewsQ: Changing the color of a HTML5 <Progress> element
I need to change the color of a Progress bar (tag <progress> HTML5) with CSS. The default of Google Chrome is like this: But if I try to style with css gets like this: How can I leave the…
-
0
votes3
answers694
viewsA: Scale div as image
The sizes of div's were proportional to the sizes of the images, as the images without the icone were larger than the same as the div's consequently were larger, with the padding you solve this.…
-
3
votes1
answer3352
viewsQ: Object appears at a certain place on the page
My question is this: I want/need a code for my site, which works the way of this website. In it, when the user uses the scroll mouse to scroll down a bit on the page, a little arrow (which when it…
-
3
votes5
answers363
viewsQ: What does ? and : within an expression?
I saw on a website the following code: var campo1 = document.getElementById('valor1').value; var campo2 = document.getElementById('valor2').value; var maior = (parseFloat(campo1) >…
-
3
votes2
answers11327
viewsA: Iframe view of PDF
If you are looking for a full visualizator on this website There are several examples with demonstrations and downloadable files. There is a jQuery plug-in PDF viewer and tutorial with examples. Due…
-
0
votes3
answers18253
viewsA: Stylization of Option via CSS
Whenever you try to style an option you will not style it, only some assignments given to the selects will also be assigned to the options. For example select{ width: 250px; height: 50px; font-size:…
-
-2
votes4
answers9544
viewsA: How to display parts of a page only after loading the entire content of the site?
In css define: // Seletor com ID #parte{ display: none; } In jquery: $(document).ready(function(){ // Seletor com ID $('#parte').css("display", "block"); }) When the document is read (loaded) to…
javascriptanswered Samir Braga 10,016 -
0
votes2
answers690
viewsA: Send variables using POST
This is because For content running on Adobe AIR, when using the navigateToURL() function, Runtime treats a Urlrequest that uses the POST method (one with the method property defined as…
-
5
votes1
answer5119
viewsQ: Transition effect on jQuery
I’m starting in jQuery and I have a question: is there any way to let the change down with a kind of transition? <html> <script type="text/javascript"…
-
4
votes2
answers937
viewsA: How to animate the layout of Divs and caption, when doing Hover in one of these elements?
Put the following in HTML. O max-width it is necessary because without it it is as if the text occupies the whole screen horizontally: <h5 id="texto" style="max-width: 150px" class="nome_equipa1…
-
9
votes1
answer11808
viewsQ: How does parseFloat()' function work?
I wanted someone to explain to me how this function works. For example: What is the difference of: var valor1 = 50; var valor2 = 40; var result = valor1 + valor2 To: var valor1 = 50; var valor2 =…
javascriptasked Samir Braga 10,016 -
1
votes2
answers2104
viewsA: How to add R7 portal bar on site?
Follow a template, if you want to modify (remove/add) something in the bar. View demo in Jsfiddle HTML <link rel="stylesheet" type="text/css" href="https://cadastro.r7.com/css/reset.css">…
-
2
votes3
answers3426
viewsA: Disable zoom google maps does not work
Here’s a full code that works the zoom lock: <!doctype html> <html lang="pt,BR"> <head> <meta charset="UTF-8"> <title>API Google Maps V3</title> <!--…
-
2
votes4
answers349
viewsA: Every N repetitions display X in PHP
A possible solution would be in jquery: $( ".classdesejada:nth-child(4)" ).css("background", "rgba(0, 0, 0, 0)" );
phpanswered Samir Braga 10,016 -
0
votes3
answers3426
viewsA: Disable zoom google maps does not work
For you to put that zoom control is false, before you will have to specify which portion of the desired zoom. var mapOptions = { zoom: 17, //Por exemplo draggable: false, zoomControl: false,…
-
-1
votes2
answers538
viewsA: Remove Select2 parameters
This plugin comes by default with get method which causes this in the Url, switching to post method I imagine the problem is solved, but it’s just a guess. ajax: { type: 'POST', url:…
-
2
votes5
answers2024
viewsA: Replace If/Else with Case javascript
When you put the else if you will have to put a new condition. For example: else if( x > y) { }; But in the last term, the last condition must be a else which corresponds to say that no previous…
-
2
votes2
answers1731
viewsA: How to make a fixed and retractable footer similar to the Economy page of the Earth portal?
Create a footer with a id="rodape" and then put in css: html: <footer id="rodape"><a style="position: relative; right: 0px; float:left; font-size: 50px; display: block; text-decoration:…
-
5
votes2
answers14618
viewsA: Select styling via CSS
Just add in css: select{ width: 250px; height: 50px; font-size: 20px; background: #f2f2f3; padding-left: 100px } In the case of text-align: center this does not work, to align just use the…