Posts by Victor Debone • 615 points
4 posts
-
3
votes3
answers4043
viewsA: How to add a CSS class to images that didn’t load?
You can assign an event to error on the desired images and add the class failToLoad Example $("#falha") .on('error',function(){ $(this).addClass('failToLoad'); console.log('Essa imagem nao…
-
38
votes2
answers1727
viewsA: What is the function of the ~ (til) Javascript operator?
This is an operator of binary negation, it operates by flipping bit to bit a number. Simplified example var x = 4; /* Em binário é representado como 100 */ var y = ~x; /* Agora o x invertido é…
-
3
votes2
answers531
viewsA: How to avoid conflict between jQuery and Mootools
To avoid conflict between these libraries you can create a closure and limit to a certain scope the variables created and defined To do this in Javascript we use functions function criarClosure(){…
-
4
votes4
answers2572
viewsA: Expandable menu CSS transitions
Defining the height of each <li> as zero by default(default), you can set the height as 20px when you are .opened, even though it doesn’t have exactly the same visual effect Example…