Posts by thiagonzalez • 169 points
5 posts
-
2
votes3
answers2323
viewsA: How to know if you are resize in width or height?
Try something like this: $(document).on('ready', function() { var width = $(window).width(), height = $(window).height(); $(windows).on('resize', function() { if($(window).width() != width) {…
-
1
votes6
answers20110
viewsA: How to center the content of an element vertically?
I did the table-Cell method until I discovered an even better one: .element { position: relative; top: 50%; transform: translateY(-50%); } Apply this to the element you want to center vertically. No…
-
1
votes2
answers570
viewsA: Handle 1-pixel edge to avoid double edge (1+1 pixels) with side-by-side elements
The simplest way to do this is by using box-Sizing and edges concentrated in both UL and Lis. See: ul, li { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } ul…
-
9
votes4
answers13539
viewsA: How to prevent a click on a link/anchor or tied event element
I usually use the preventDefault event, via jQuery. See: $('.elemento').on('click', function(e) { e.preventDefault(); alert('Você clicou aqui e nada aconteceu!'); });…
-
3
votes4
answers7004
viewsA: Create a triangle with CSS
I use this method a lot of creating a triangle with edges, but, if I understand your question well, and looking at the images you gave of example, you want a triangle that cannot be done with edges,…