Posts by Thiago Santos • 1,957 points
72 posts
-
2
votes4
answers1791
viewsA: Display login username on screen
PHP SESSION You have stored the user name in SESSION so just call it in the code, change it as follows: Olá, <p id="usuario"><?php echo $_SESSION['nome_usuario']; ?></p> // Pode…
phpanswered Thiago Santos 1,957 -
5
votes2
answers33940
viewsA: How to hide sidebar and vertical bar with CSS
It is necessary to verify which element is bursting, that is, having its width/height exceeded by the content size, and apply overflow: hidden; to that element: body { overflow: hidden; }…
-
0
votes1
answer67
viewsA: Scroll effectTo JS , make it work by clicking on <li> and not only on <a href="#">
I changed your code to be triggered by clicking on <li> and search using the .find() the element <a> inside him and retrieve his href: $(function(){ var wrapper = $("#wrapper"), $menu =…
-
1
votes1
answer37
viewsA: Is it possible for the user to edit the session?
PHP SESSION The use of the $_SESSION variable is very common and extremely widespread, very safe but has two points that can be "unsafe": The first is called "Session fixation". Basically, how the…
phpanswered Thiago Santos 1,957 -
0
votes4
answers901
viewsA: Table element with several lines but different number of cells, how to center?(HTML)
INLINE-BLOCK Taking advantage of the property inline-block I believe you will achieve the desired result (note that this solution does not apply to tables): .linha { height:106px; text-align: left;…
-
2
votes2
answers126
viewsA: Selecting attributes from Bootstrap
DATA ATTRIBUTES Adding attributes with data (Data Attributes) aims at the extensibility of HTML5 tags. Attributes can be accessed in two ways, via pure Javascript or jQuery. With pure Javascript via…
-
0
votes1
answer455
viewsA: use dynamic INPUT for database query
JQUERY DELEGATE jQuery assigns an event to the item when called, i.e., if when jQuery was executed the item did not yet exist, it would be impossible to attach the function keyup to him. However,…
-
0
votes2
answers74
viewsA: getDate() from Javascript returning NULL
I updated your function to return Date inside an element with ID, but you can use querySelector if applicable: $(function() { var data = new Date(); var dia = document.querySelector('#aqui'); var…
-
2
votes1
answer994
viewsA: Change content by hovering over a div
ONMOUSEOVER The most direct approach, through pure Javascript, uses onmouseover to call a function and thereby change the display of items: function mudar(val) { var x =…
-
0
votes3
answers1453
viewsQ: $. getJSON - How to store responseJSON in a Variable?
I am mounting a Javascript object with the following constructor: var jsonResult = ""; // Inciei uma variável fora do escopo da Função function criarDicionario(lang) { this.lang = lang; this.dicio =…
-
3
votes3
answers2684
viewsA: How to check if the form was sent empty
In a very simplified way: <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="input_txt"/> <input type="text" name="input_txt2"/>…
phpanswered Thiago Santos 1,957 -
2
votes1
answer4958
viewsA: Catchable fatal error: Object of class stdClass could not be converted to string in
OBJECT OF CLASS STDCLASS When using json_decode() you have as a result an Object, or an Array of Objects (Source) and, when using ECHO in an Object, it causes an attempt to convert it to String,…
phpanswered Thiago Santos 1,957 -
1
votes1
answer60
viewsA: identify when the page is opened in a popup
WINDOW.OPENER When opening a page using techniques such as window.open, the variable Window.opener is fed with the information of the page that generated the request. If the page has not been opened…
-
1
votes1
answer252
viewsA: Animation when expanding item in a sidebar
CSS3 TRANSITION Applying transitions is possible with CSS3 Transition and applying to your case: $("a").click(function() { if($(".intern").css("height") != "100px") { $(".intern").css("height",…
-
-2
votes1
answer446
viewsA: Delete a css selector
PARENT SELECTOR What you’re trying to do is called Parent selector which is a type of selector that NAY exists in CSS, nor in CSS3. Explaining a little better, you want to style an element according…
-
0
votes3
answers955
viewsA: change soon when decreasing screen width
MEDIA QUERY The method for working with screen widths and responsiveness is the CSS Media Query, and may be applied as follows: img { transition: 0.52s all; padding: 25px; display: block; width:…
-
7
votes2
answers1395
viewsA: What is the difference between ~0.0.1 and 0.0.1 in package.json version control?
In a simplified way TIL (~) accepts only minor version most recent (the middle number). ~ 1.2.3 will accept all 1.2.x versions but will reject 1.3.0. The CIRCUMFLEX ( ) accepts the latest Major…
-
0
votes2
answers581
viewsA: Changing the contents of a <optgroup> label when selecting an option in another select
ONCHANGE-BASED CHANGE A function activated in onChangecan be handled as follows: function mudar(val){ document.getElementById("mudar").label = "Novo Tipo de Bolo "+val; } <p><select…
-
2
votes1
answer1133
viewsA: Create dynamic inputs from a json object
JQUERY APPEND With the .append() from jQuery you solve it like this: $(document).ready(function() { var options = []; // adicionar linguas ao ao objeto para mostrar $('#add-lingua').click( function…
-
4
votes3
answers42294
viewsA: Select option from a select
GETELEMENTSBYTAGNAME INSIDE ANOTHER ELEMENT In pure javascript it is necessary to select only the <option> within the <select> with the ID set and find its value if there is no NULL…
-
3
votes2
answers615
viewsA: Json filter in Angularjs
ANGULAR FILTER To solve your problem just use the Filters of Angular, the following example: var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.valores = [ {…
-
3
votes1
answer150
viewsA: Query is returning an empty array (Mysql/Wordpress)
LIKE OPERATOR The array is being returned empty because you are looking for 'candidate' (exactly) and actually the record comes as "a:1:{s:9:"candidate";b:1;}". LIKE will perform a rough search and…
-
0
votes4
answers2773
viewsA: How to mount buttons with Angular?
Bringing Angularjs ng-click functions: var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.message = ""; $scope.sim = function() { $scope.message = "Clicou…
-
3
votes3
answers132
viewsA: Ul list with independent dynamic width of items
This way it works by decreasing the size up to 6 items: .bloco { background:#CCC; padding:0; min-height: 150px; max-width:600px; padding: 4px; } .item { transition: all 0.42s; display: inline-block;…
cssanswered Thiago Santos 1,957 -
1
votes2
answers1368
viewsA: How to pass the dynamic id of a Div to a javascript function?
The following way you capture the click using $('td a').click() and the ID on var tmp = this.id;: $(function () { $('td a').click(function () { var tmp = this.id; $('.'+tmp).toggle('slow'); return…
-
0
votes1
answer28
viewsA: Problem with static title and button
I changed your styles a little to make it easier to edit, I applied a padding: 250px; in class .hero-image and manipulated the margin-top and margin-bottom of H1 freely: .container { width: 980px;…
-
4
votes1
answer1362
viewsA: How to display message in Angularjs?
In a simple way, making a function display a message: var app = angular.module('root', []); app.controller('myCtrl', function($scope) { $scope.message = ""; $scope.validarProtocolo = function(){…
-
1
votes1
answer58
viewsA: Colorize a column field according to parameters
Make the following Change in your PHP: if($row['notaQualif'] > 75) echo '<td class="bgVerde">' . $row['notaQualif'] . '</td>'; else echo '<td class="bgVermelho">' .…
-
1
votes1
answer1467
viewsA: Always return to the top of the screen by clicking on links of a SPA with Angular.Js
Using only Angular, I found the ngView documentation, which recommends using: <div class="ng-view" autoscroll="true"></div> But if you want to use a little jQuery does the following,…
angularjsanswered Thiago Santos 1,957 -
7
votes2
answers429
viewsA: What is CSS Aural?
CSS Aural - Styles for Visual Accessibility It is commonly used by blind people who have difficulty seeing or who do not have a screen for viewing. It is used, for example, by Screen Readers, which…
cssanswered Thiago Santos 1,957 -
2
votes2
answers637
viewsA: Insert array within an angular scope
Hello you are really about writing the Array. Remove that part $scope.apostas = [ {timeApostado: time, partidaApostada: partidaA, cotacaoApostada: cotacaoA, idDaPartida: idpart} ];…
-
6
votes2
answers157
viewsA: Regular Expression
In the minimum 8 letters, at least one Maíscula, at least one Lowercase, at least 1 Number and accepting special: ^(?=.*[a-zç])(?=.*[A-ZÇ])(?=.*\d)[\S\s]{8,}$ Here is a link to tests EXTERNAL.…
-
1
votes1
answer56
viewsA: Tag video by createelement
Try creating the widget as follows: var player = document.createElement('video'); player.src = 'video1.webm'; player.autoPlay = true; So it will set playback automatically. Your problem may also be…
-
1
votes1
answer54
viewsA: Page content escaping from the parent element
With the CSS vh is very quiet to resolve: .front-page { height: 100%; } .front-page main { margin-top: 0; padding-top: 40px; height: 100%; } #front-bg { position: absolute; top: 0; left: 0; z-index:…
-
1
votes1
answer352
viewsA: Find previous sister div in CSS
Try styling the CSS like this: $(".loading").click(function(){ $('.tela').removeClass('carregando'); }); .carregando { display: none; } .load { display: none; } .carregando ~ .load { display: block;…
cssanswered Thiago Santos 1,957 -
4
votes3
answers1770
viewsA: Increase word size, placeholder attribute value of text inputs?
Option onFocus and onBlur: function change() { document.getElementById('login').placeholder = 'Alterado'; } function changeBack() { document.getElementById('login').placeholder = 'Login'; } input {…
-
2
votes1
answer548
viewsA: Display a foreach item only once (if this item is within the if condition)
First declares an auxiliary variable before the foreach: $hoje1 = 0;. Then you change the way it should work: <?php if($hoje1 == 0) { $hoje1 = 1; ?><span…
-
2
votes1
answer178
viewsQ: Gulp Watch Customizado
This is my current Gulpfile and as I am using it a lot, I would like to create a GULP WATCH that performs the uglify whenever the files are changed. var gulp = require('gulp'); var uglify =…
-
5
votes1
answer2214
viewsA: Notification, "Registration Done" message Displayed by clicking on a form button?
This is the standard method of sending messages via Javascript: function msg() { alert("Botão Clicado!"); } <button onclick="msg()">Teste</button> And here I am mounting a simple Modal…
-
2
votes2
answers1768
viewsA: Dynamically Change Field
Let’s go to Javascript then, this already makes the first part, as for the image I believe only with integration with Bank, or listing them from a folder. var prev = ""; function alterar(val) {…
-
0
votes2
answers1254
viewsA: How to pass the contents of a.txt file to a JS array?
Very simply: <script> function loadDoc() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var res =…
-
0
votes2
answers7202
viewsA: How to create and access a global variable with PHP and codeigniter
Utilizes the $GLOBALS as follows: $GLOBALS['msg'] = $msg; And within every function you can call it: global $GLOBALS; $msgGlobal = $GLOBALS['msg']; I suggest using so because I do not know the…
-
4
votes1
answer257
viewsA: foreach using css3
This code does not use JS, however you need to create DELAY for each item, with SASS it would be possible to make N items easily. I added Javascript to make the elements appear only when scrolling…
-
2
votes1
answer708
viewsA: Calculate a date from an initial date and a deadline
Maybe I got a little big the JS, but it already does what you asked. function calcDate() { var dat = document.getElementById("data").value; var meses = document.getElementById("meses").value; if(dat…
javascriptanswered Thiago Santos 1,957 -
0
votes3
answers1393
viewsA: Sort array in PHP
Giving up performance, since your internal indexes don’t seem to follow any pattern either, I made a solution for you: echo "<pre>"; $arr = array(0 => array(1 => 5), 1 => array(2…
phpanswered Thiago Santos 1,957 -
3
votes1
answer1412
viewsA: Jquery or CSS - How to create an animation that flashes back to the original?
I made a method that works using CSS3 Animation: $(".add").click(function(e) { $(".saida").addClass("backgroundRed"); setTimeout(function() { $(".saida").removeClass("backgroundRed"); }, 3500); });…
-
1
votes1
answer417
viewsA: View information in angular HTML
This usually happens when you don’t have a unique id for ng-repeat, you can, according to documentationthe, use track by $index that will make the position inside the array become the ID and I…
-
1
votes1
answer66
viewsA: Command to leave scrollbar Fixed
Tested in Chrome and Firefox: input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { opacity: 1; } <input type="number">…
-
1
votes3
answers52
viewsA: Problem with select in PHP
Do a JOIN as follows: $db->query("select a.*, b.album_name AS album_name from fotos a INNER JOIN tabela_com_album_name b ON a.foto_album = b.id_do_album")->fetchAll();…
phpanswered Thiago Santos 1,957 -
3
votes1
answer246
viewsA: Rename image before upload
Replace your $arqName = $_FILES['arquivo']['name']; for: $ext = pathinfo($_FILES['arquivo']['name'], PATHINFO_EXTENSION); $arqName = date("Y-m-d-h-i-s").".".$ext; So you rename with Date and already…
phpanswered Thiago Santos 1,957