Posts by Ricardo Mota • 2,905 points
98 posts
-
1
votes2
answers187
viewsA: Turn IP number into location
You can use the api http://ip-api.com/docs/api:json Example: GET - http://ip-api.com/json/208.80.152.201 RETURN: { "status": "success", "country": "United States", "countryCode": "US", "region":…
-
2
votes2
answers241
viewsA: Add cart values from a Session
<?php if(isset($_SESSION['product_cart'])){ $amount = 0; $count = 0; $size = count($_SESSION['product_cart']); foreach($_SESSION['product_cart'] as $data){ …
-
5
votes3
answers31945
viewsA: How to put one div overlapping another using only relative position?
You can do it like this: Using position relative section div:first-child { background-color: red; width: 150px; height: 150px; position: relative; } section div:last-child { background-color: blue;…
-
3
votes1
answer226
viewsA: Mobile responsiveness with bootstrap-material?
This problem is solved using the META TAG viewport. Basic description: The viewport is the area where your website appears Add that tag in the head: <meta name="viewport"…
-
1
votes2
answers1161
viewsA: Add CSS class in Input when Loading page
You can solve your problem like this: Jquery $(function(){ $("#input-custom-field2").addClass('cpf_cnpj'); }); .cpf_cnpj{border-color:red;} <script…
-
-1
votes1
answer28
viewsA: alignment between div
You can solve your problem like this: .container { border-radius: 4px; background: #d7d7d7; margin: 0 auto 10px; width: 900px; } .container-head { display: table; width: 100%; color: #fff;…
-
3
votes2
answers89
viewsA: Click an H3 and focus on a form field
There are a few ways you can solve your problem. The simplest would be using elements HTML, thus: <label for="minha_input"><h3>Input</h3></label> <input type="text"…
-
0
votes3
answers3264
viewsA: Show or Hide Input According to Selected Radio Button
Using your logic you can do so: $(document).ready(function() { $("#input-custom-field2, #input-custom-field3, #input-custom-field4, #input-custom-field5, #input-custom-field6").hide(); });…
-
1
votes2
answers1694
viewsA: Place an icone with css in a div
You can solve your problem like this: $(document).ready(function() { $('.masterTooltip').hover(function() { var title = $(this).attr('title'); $(this).data('tipText', title).removeAttr('title');…
cssanswered Ricardo Mota 2,905 -
1
votes1
answer161
viewsA: Capture document width with scroll bar
You can solve your problem like this: $(function(){ var hasScroll= document.body.scrollHeight > document.body.clientHeight; if (hasScroll) { // Aqui são suas definições/regras se existe a barra…
-
0
votes1
answer235
viewsA: How to access a project route (URL) written in Laravel from another project (URL) that does not use Laravel?
Completely, Would look like this: myApp1.com <a href="http://myApp2.com/do-something/">Faça algo em myApp2.com</a> myApp2.com Route Route::get('do-something',…
-
0
votes2
answers1283
viewsQ: How to exchange values of two variables without using a third one in php
My question is very objective. I need to exchange values of two variables without using a third one in php. NOTE: Using array/array is not an option. Researching I found a solution in linguagem c…
-
3
votes2
answers5104
viewsA: Good CSS practices for responsive Height. Is it armengue or not?
You can optimize by doing this way: html, body { width: 100%; height: 100%; margin: 0; padding: 0; } section { position: relative; display: table; height: 100%; width: 100%; } section div { float:…
-
1
votes1
answer607
viewsA: Changing the content of Modal Laravel 5.1
I just made a very simplistic example and it worked here. See if it helps you: Route Route::get('see/{id}', 'Adm\UsuarioController@show'); Controller $data['usuario'] = User::find($id); Request…
-
0
votes2
answers88
viewsA: Change Preposition According to State
An alternative route json worked smoothly here: $(function(){ $.ajax({ url: "http://ip-api.com/json/208.80.152.201", context: document.body }).done(function(response) { console.log(response);…
-
37
votes1
answer3274
viewsQ: Which CSS selector has priority?
I have the following code HTML and CSS: #element p{color:blue;} .element p{color:red;} div p{color:pink;} div.element p{color:yellow;} div[name="element"] p{color:purple;} div…
-
1
votes3
answers52
viewsA: Positioning of a thumbnail
You can solve your problem like this: .post-thumb > a{ display: block!important; height: 180px!important; /*Aqui seria a altura máxima que você quer*/ overflow: hidden!important; position:…
-
2
votes2
answers4079
viewsA: Javascript required HTML attribute
You can solve your problem like this: <form> <fieldset> <input type="number" name="" min="1" max="10" id="ordem-banner" pattern=""> <label class="switch"> <input…
-
3
votes2
answers53
viewsA: Problem in product layout in Grid
So Wendell the problem is that you only have columns(col). Your code today is like this: ... <div class="product-layout product-grid col-md-4"></div> <div class="product-layout…
-
2
votes2
answers44
viewsA: Javascript command does not work inside Buttom
Your problem is because of the quotes. Here are some alternatives to solve your problem: 1° Concatenate quotes. echo "<button type='button' class='btn'…
-
4
votes3
answers1842
viewsA: same div with different colors
You can make use of the selectors Odd and Even css. Would look like this: div{ width: 150px; height: 150px; color: #fff; font-size: 25px; text-align: center; font-family: Arial; display: table-cell;…
-
1
votes2
answers530
viewsA: Jquery - Compare 2 arrays in each
In that case you need 2 $.each. Thus: // primeiro laço $.each(data, function(key_data_first, item_first) { // segundo laço $.each(data, function(key_data_second, item_second) { // cria o select $(…
jqueryanswered Ricardo Mota 2,905 -
0
votes1
answer28
viewsA: Animation "speed up" - js
The concept of this effect can be based on easing jquery, but this site used that plugin. Besides these other: http://owlgraphic.com/owlcarousel/ http://fitvidsjs.com/…
-
6
votes5
answers163
viewsA: Is there a tool to make html manuals easy to update?
In addition to the aforementioned doxygen and phpDocumentor. We can add to the list: Dexy Apiary (paid) Docco (coffeeScript) Daux (very good) Natural Docs Helpndoc I hope I’ve helped.…
-
1
votes2
answers85
viewsA: Add form fields with jQuery to be sent in php
In this case you will have to transform your inputs into an array. Just add [] after the name thus: <input name="MyArray[]" /> <input name="MyArray[]" /> <input name="MyArray[]" />…
-
1
votes2
answers411
viewsA: Where in integer field[] Postgresql
I know two ways to do: 1st form: SELECT * FROM tarefas WHERE Setores = ANY(ARRAY[2, 4]); Second form: SELECT * FROM tarefas WHERE Setores IN (2, 4);…
-
9
votes3
answers20650
viewsA: When to use Success: Function() and . done(Function()) in asynchronous requests?
This has always been a great paradigm for me too. I’ve researched about and I’ll tell you what I could absorb. In the beginning it was always used the callback success speaking of $.ajax. But when…
-
-1
votes1
answer110
viewsQ: Query to join specific tables
I need to put together three different tables. But the result I want is: When there is the reference it must join, when there must be no blank or NULL. My structure: Table contact…
-
0
votes2
answers422
viewsA: Send form as active tab
Here is a solution to your problem. I added a small script to know which form we are giving submit. We could force the submission via javascript but this would ignore its validation via HTML5…
-
1
votes1
answer72
viewsA: Change site via . htaccess
It would look like this using 301 redirect via htaccess: redirect 301 /pagina1 http://meunovosite.com.br/pagina1 redirect 301 /pagina1/a/b/c http://meusite.com.br/pagina1/a/b/c redirect 301…
htaccessanswered Ricardo Mota 2,905 -
2
votes1
answer75
viewsA: How to Switch Between Table Values
It does what you wish: Using Jquery $("button").click(function(){ var text_01 = $("#cell-01").html(); var text_02 = $("#cell-02").html(); $("#cell-01").html(text_02); $("#cell-02").html(text_01);…
-
4
votes2
answers1572
viewsA: Hide modal by clicking the bootstrap "Close" button
You need to do it like this: $('#myModal').modal({backdrop: 'static', show: true}); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <link…
-
1
votes1
answer121
viewsA: Mounting an html frame from a php array
If the problem is to assemble Table 01, follow the solution: <?php //Criando o array mencionado $array_original = array( 0 => array( 'cienciaNome' => 'Biologia', 'materiaNome' =>…
-
2
votes1
answer821
viewsA: Accept comma in jquery / Javascript calculation
An alternative to your problem is to turn ',' into '.' while the user type: $('input[type="text"]').keyup(function(){ var val = $($(this)).val().replace(',','.'); $($(this)).val(val); }); <script…
-
3
votes1
answer191
viewsA: How do I know the country of a particular IP?
You need to install the PECL extension to work. Link: http://php.net/manual/en/geoip.installation.php I hope I’ve helped.…
phpanswered Ricardo Mota 2,905 -
3
votes1
answer408
viewsA: mounting an array with php for p phpmailer
Try to do it that way Hugo: // Define os destinatário(s) $consulta = $mysqli->query("select email, nome from clientes where status=true"); while ($resultado = mysqli_fetch_object($consulta)) { //…
-
1
votes1
answer76
viewsA: Emoticons on posting system
You can use that plugin very simple to implement It works that way: $('.comment').emoticonize(); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>…
-
4
votes2
answers998
viewsA: Animation when changing the display into HTML
I think this might help you a little: function obj(x) { return document.getElementById(x); } function ApertarBotao() { obj("form-pergunta").style.display = "block"; } #form-pergunta{ width: 300px;…
-
1
votes2
answers60
viewsA: Create custom variables
I believe that solves your problem: <?php $count = 0; $res = $mysqli->query("SELECT * FROM payments WHERE client_email='$xemail'"); while($row = $res->fetch_array()){ $top[$count] =…
-
2
votes2
answers87
viewsA: Help in identifying effect on site
Our friend War is right, the site mentioned uses particles. Its basic implementation is like this: /* ---- particles.js config ---- */ particlesJS("particles-js", { "particles": { "number": {…
-
4
votes3
answers3191
viewsA: Should I use the «or die»?
I believe that everything will depend on the context that you are working. The side 'bad' to use the die is that your execution will end up right there. Regardless of the error. Using other methods…
phpanswered Ricardo Mota 2,905 -
3
votes1
answer162
viewsA: Send e-mail to 1 contact array, with phpmailer
You can do it like this: $recipients = array( '[email protected]' => 'Person One', '[email protected]' => 'Person Two', // .. ); foreach($recipients as $email => $name) {…
-
1
votes3
answers933
viewsA: grade table
That solves your problem: function calcula_media(i){ var n1 = document.getElementsByName("n1")[i].value; var n2 = document.getElementsByName("n2")[i].value; var media =…
javascriptanswered Ricardo Mota 2,905 -
17
votes5
answers7326
viewsA: Is Javascript an Object-Oriented language?
To be object oriented a language must meet the 4 pillars that are Abstraction, Encapsulation, Inheritance and Polymorphism. In Java Script we can apply the 4 concepts easily as shown below:…
-
2
votes2
answers1121
viewsA: Receiving an array as a parameter in a PHP function
I populated the arrays with fictitious values to find out if there was any error. And I found some. Follow the corrected code that returns the values: function Preco($p){ //$faixaEtaria = array(10,…
-
1
votes2
answers283
viewsA: How to launch/stop via jquery a css animation (which is being triggered by css Hover)
That solves your problem: $("#doIt").click(function() { //Start animação //alert("ok"); $("#badgeAnimation").addClass('hvr-ripple-out'); }); $("#stopAnimation").click(function() {…
-
0
votes2
answers341
viewsA: How to create a menu that performs an effect with jquery
You can do this done in many ways. One simple way to do it is with JS like this: // nav $('#navbar-click').click(function() { if (!$('.nav').hasClass('open')) { openMenu(); } else { closeMenu(); }…
-
1
votes1
answer1046
viewsA: css3 effect when div appears
You can use the plugin scrollReveal to solve your problem. It is very simple to use and has a complete documentation. It would look something like this: // JavaScript window.sr = ScrollReveal();…
-
1
votes2
answers105
viewsA: Transition in CSS sequentially
In this case it will be a little complex because you will work with the animations in CSS. An alternative is to use setTimeout and delay to manipulate the duration time between animations. I made a…
-
2
votes5
answers14748
viewsA: Take part of a string delimited between characters
In this case you can use one of the functions split of PHP One of the simplest ways would be using explode() that would look like this: $string = 'Lorem ipsum dolor sit amet, consectetur /adipiscing…