Posts by Felipe Duarte • 6,284 points
276 posts
-
3
votes3
answers394
viewsQ: Is it possible to remove the option all files in the file explorer?
With accept I can specify which formats are accepted. <input type="file" accept="image/png"> It filters, but in the explorer it is still possible to select all files as in the photo. It is…
htmlasked Felipe Duarte 6,284 -
0
votes2
answers512
viewsA: Check empty fields with foreach
Starting with logic, you are creating a form dynamically, with the data coming from the database, legal, but the 'mandatory' field in the form column, will serve no purpose, when submitting the form…
-
2
votes1
answer55
viewsA: Doubt about icons in UX (Font-awesome)
In the context of need, I understood something like tasks to be performed, following this logic, intermediate task is very close to important task, to differentiate can use a hourglass-half (giving…
-
0
votes2
answers54
viewsA: HTML form values are not varying within while PHP
Use fetchAll instead of fetch The fetch will return you a simple array, it is ideal when there is only one record, already fetchAll return an array with all results.…
-
1
votes5
answers2427
viewsA: Get clicked element position
An alternative is to use the rowIndex, which takes the actual position of the element in the DOM, just reference it with this, example. var arr = ['tr1','tr2']; var tr =…
-
2
votes3
answers872
viewsA: How to create scroll link to target page
If you are using PHP, can pass a parameter in the link, similar to www.seusite.com.br/video1? scroll=true In section video1 check if GET['scroll'] == 'true', if so, from a print in the following…
-
1
votes2
answers22
viewsA: Simple problem with CSS alignment
For a less semantic and maintainable solution use flexbox #head { display: flex; height: 200px; justify-content: space-between; align-items: center; } .ant,.prox { height: 70px; padding: 10px; }…
cssanswered Felipe Duarte 6,284 -
1
votes3
answers4370
viewsA: How to add opacity only to the image?
You can get this effect by using after, example... div { width: 100%; height: 100vh; position: relative; } span{ color: red; } div::after { content: ""; background: url(https://fakeimg.pl/300/);…
-
1
votes3
answers447
viewsA: Take JSON object dynamically
As stated in the avsinacio response, you can pick up the index of an object in javascrit by means of the [], looks something like this var json = [ {'PHP': [ {'aula1': [ 'txt','O PHP é uma linguagem…
-
2
votes2
answers160
viewsQ: Dynamic properties in Vue 2
I’m studying reactive frameworks for a project, and one of the features I need is the creation of dynamic properties, in angularJs just start a ng-model that the property was created, but I see that…
vue.jsasked Felipe Duarte 6,284 -
13
votes5
answers1023
viewsA: What is the difference between starting an empty variable and starting directly with the value?
An acceptable reason is to avoid undefined, for example... class teste { public $teste = ''; public function mudar(){ if(1 < 0){ $this->teste = 'mudou'; } } public function exibir(){ echo…
-
2
votes1
answer44
viewsA: Multiple components in Vue.use
Note the native method /* @flow */ import { toArray } from '../util/index' export function initUse (Vue: GlobalAPI) { Vue.use = function (plugin: Function | Object) { const installedPlugins =…
vue.jsanswered Felipe Duarte 6,284 -
1
votes1
answer38
viewsA: Auto-redirect
Check if the parameters exist with GET. PHP <?php if(!isset($_GET)) header('Location: suapagina.php'); ?> Javascript var pageURL = window.location.href.split('&'); if(pageURL.length <=…
-
0
votes1
answer240
viewsA: Change div CSS with click
Just reference them by the same class, and with each verify whether display_n was set, also to have the control the id of the button must be contained in the class of images, example...…
-
1
votes3
answers1550
viewsA: Jquery - Color HTML element border
You can use the blur, when taking the focus of the input it triggers the event, if it does not pass the validation the input is changed, example... checking if it is empty…
jqueryanswered Felipe Duarte 6,284 -
3
votes3
answers3786
viewsA: Click on a button on a web page automatically
To simulate a click just use the method click(), to get support most browsers use the function below. function click(id) { var element = document.getElementById(id); if(element.click)…
javascriptanswered Felipe Duarte 6,284 -
1
votes1
answer104
viewsA: What is and what are the differences between DOM, Window and Screen?
In a simple approach, window is a window object DOM, a global property that provides methods referring to the root of the model, 'so window', it is within it that the DOM. window MDN screen is one…
javascriptanswered Felipe Duarte 6,284 -
3
votes1
answer149
viewsA: Opacity does not work
Simple error, use :hover nay ::hover. * { margin:0; padding:0; } div.slideShow { position:relative; width:100%; } div.slideShow div.boxSlide { position:relative; width:100%; } div.slideShow…
css3answered Felipe Duarte 6,284 -
0
votes3
answers767
viewsA: Remove attribute from a DIV only in mobile version
Only complementing, to get control of browser resizing just use the method resize of jquery, example $(document).ready(function() { windowWidth = window.innerWidth; if(windowWidth <= 769) {…
-
3
votes1
answer50
viewsA: How to apply this scrolling function?
Your question is very broad but I think that’s it... $('#search').click(function () { var el = $('#' + $('#param').val() ); if(el != "undefined") { $('html, body').animate({ scrollTop: $( el…
-
2
votes1
answer2083
viewsA: How to customize reCAPTCHA v2?
It’s really necessary to make reCAPTCHA responsive? In my view it is not necessary, it is not a native/standard component, to conform to other inputs, but rather an external application that often…
-
0
votes2
answers211
viewsA: Sort styles with prefixes in CSS
Why some styles do not need prefixes (such as background, for example)? Because its specifications have already been adopted in virtually all browsers, that is, prefixes usually work when the…
-
1
votes1
answer58
viewsA: How to validate defaultPrevented = false in my Angularjs test?
Default prevented was defined here (remembering that this event only works effectively on object DOM) srv.ev = { defaultPrevented: false } By calling onRemoveInstance, onCheckSession is modifying…
angularjsanswered Felipe Duarte 6,284 -
0
votes1
answer176
viewsA: Node.js routes with Angular.js
In MEAN Stack Mongo is used to save information, NodeJs to the back-end, express to help in the development Nodejs, and angularJs to the front-end, that is, the Angularjs will take care of the…
-
2
votes3
answers641
viewsA: Check if window load is false
Method load has the following parameters .load( url [, data ] [, complete ] ) example of functioning $( "#success" ).load( "/not-here.php", function( response, status, xhr ) { if ( status == "error"…
-
6
votes1
answer3666
viewsQ: What is an automated test?
Looking over the top, the term in question seems to me essential in the development routine, so simply, what is an automated test and what are the advantages? if possible a practical example of how…
testingasked Felipe Duarte 6,284 -
1
votes3
answers70
viewsA: Prevent a value from being selected in the dropdown
Using Vanilla. document.getElementById('teste').onclick = function (event){ if(event.target.options) el = event.target.options[event.target.options.selectedIndex]; }…
-
0
votes3
answers1111
viewsA: Invert Divs positions with responsive
An alternative is property order of flexbox... .a-right { padding: 2%; width: 30%; margin: 0; -webkit-box-ordinal-group: 2; -ms-flex-order: 1; order: 1; } .a-center { padding: 2%; width: 50%;…
-
13
votes2
answers237
viewsQ: Is it correct to adopt a design specification for an entire project?
I see many frameworks, migrating to a visual based on design material and using flexbox to contain the elements, among them. Bootstrap Materialize Quasar Foundation UI material Whereas they are UI…
-
1
votes1
answer526
viewsA: Paging with Jquery
Use the elements this way <div id="pagination"> <figure><img src="https://fakeimg.pl/50/"></figure> <figure><img src="https://fakeimg.pl/50/"></figure>…
-
0
votes1
answer24
viewsA: How to limit database call number on different monitors
With PHP it’s complicated but there’s a way. <?php if(!isset($_GET['mobile'])) {?> <script> if(window.innerWidth < 920){ window.location.href = "?mobile=true"; } </script>…
phpanswered Felipe Duarte 6,284 -
3
votes1
answer141
viewsA: CSS + Java Script : Treating image larger than a circular div
Inline function clickImagem(src) { $('#conteudo').empty(); var el = document.getElementById('conteudo'); $(el).html('<img src="'+src+'">') } .conteudo{ width:320px; height:300px;…
-
3
votes1
answer68
viewsA: Framework for single page application
I don’t think anyone would use a framework just for routing, if you use it Angularjs just import the angular route, and manage the routes in an easy way, however the Angularjs is very bureaucratic…
-
1
votes1
answer1995
viewsA: Typeerror: Cannot read Property of Undefined
Correct index var teste = [{ teste : 'oi', nome : 'teste' }]; console.log(teste[0].teste); Return: hi indefinite var teste = [{ teste : 'oi', nome : 'kk' }]; console.log(teste[null].teste); message…
angularjsanswered Felipe Duarte 6,284 -
5
votes4
answers613
viewsA: Change the position of a <li> to the first position
Basically $('li').click(function(){ $($(this).closest('ul')).prepend($(this)); }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul…
-
3
votes2
answers1319
viewsA: Print all form values in the console with Jquery?
Just serialize with serializeArray and turn into JSON. var dados = JSON.stringify( $(#form1).serializeArray() ); // <----------- console.log( dados );…
-
0
votes3
answers3219
viewsA: How to align image next to image
Images are automatically placed next to each other in default, example... <div> <img src="https://fakeimg.pl/100/"> <img src="https://fakeimg.pl/100/"> <div> if you want to…
-
0
votes3
answers191
viewsA: Operations with multiple input js
Search for "Total Prod" according to the this $(document).ready(function(){ $(document).on('change', '.peso', function() { var v = $(this).val(); var c = $(".bracas").val();…
-
2
votes1
answer107
viewsQ: How to unlink object elements?
I have the following function addPerson = function(id, name) { people[id] = name; console.log(people[id].parentNode); // Exibe corretamente console.log(name.parentNode); // Exibe corretamente…
-
1
votes1
answer739
viewsA: Centralize content in a CSS border
use line-height about the same height as elemento ul { list-style: none; } .menu_2{ padding: 10px; font-size: 10pt; margin-top: 20px; color: #6495ED; } .user{ margin-right: 30px; font-size: 12pt;…
-
10
votes3
answers1528
viewsA: Format search field with CSS button
.idem { padding: 15px; border: 1px #DDD solid; } .idem:nth-child(1){ width: 300px; border-radius: 10px 0px 0px 10px; } .idem:nth-child(2){ width: 40px; border-radius: 0px 10px 10px 0px;…
-
0
votes1
answer140
viewsA: Data disappears when clicking the back button
Use resolve is basically a condition to be met before the view is loaded, in angular, example of documentation class Backend { fetchTeam(id: string) { return 'someTeam'; } } @Injectable() class…
-
2
votes2
answers145
viewsA: CSS and Jscript - Resize onClick image
Add the parameter cover in background-size function clickImagem(src) { $('#conteudo').empty(); var el = document.getElementById('conteudo'); $(el).css('background',"url('"+src+"') no-repeat…
-
5
votes3
answers103
viewsA: How can I decrease the size of this function?
If you want to validate before... function adc_atalho(qm){ var btnAtalho = document.getElementById("botaoAtalho" +qm ); var btn = document.getElementById("botao" + qm); var btnRemover =…
-
1
votes2
answers1426
viewsA: Render an html in Node with js
Place config.js in the root folder, so it is easier to keep the project, and the application files in the folder app(can choose any name), index.html can be isolated as it is also easier to…
-
1
votes2
answers61
viewsA: Form field above all elements on page
What happens is that sometimes we structure the css and we don’t care about the hierarchy in the DOM, elements such as the inputs, tend to overwrite everything that is not set with proper z-index…
-
4
votes2
answers560
viewsA: Change DIV via jQuery
Would that be? function resize(){ if (largura < 750) { $('.carrinhoDesktop').attr('class', 'carrinhoMobile'); var carrinho = $('.carrinhoMobile'); $('.carrinhoMobile').remove();…
-
6
votes1
answer210
viewsQ: What is a static website generator?
Recently I came across this theme, more precisely the tool Hugo, that basically builds sites from themes and Apis reminding a lot of Ruby on Rails. I ran a test on build of an application that uses…
hugoasked Felipe Duarte 6,284 -
1
votes2
answers1840
viewsA: Change CSS with jQuery
Use addClass, or toggleClass to take and to each click $('div').on('click', function() { $(this).addClass('before'); }); div.before:before { content: "before adicionado "; } <script…
-
1
votes3
answers816
viewsA: Center Vertically
Use flexbox .line_teste { display:-webkit-box; display:-ms-flexbox; display:flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; min-height:100px; } .check_teste { padding:…