Posts by Gustavo Carvalho • 461 points
4 posts
-
7
votes1
answer2114
viewsA: How to change the URL of an image when the resolution is below 767px
Using pure Javascript we can check the property window.innerWidth of the global object, which represents the width of the browser window in pixels. <img id="logo" src="branca" />…
-
3
votes3
answers1676
viewsA: How to set a max-width to a div that increases and decreases proportionally?
See the result on Jsfiddle, using pure Javascript to manipulate the CSS properties of the slide element. Note that the property padding-bottom: 75%; slide class was removed, since the dimensions of…
-
1
votes1
answer135
viewsA: Function Javascript Error Frame
Below is an example using javascript to change the CSS class of the element, after checking some error condition. Click here to view the example in JSFIDDLE. In the example I use the events CHANGE…
-
19
votes3
answers12960
viewsA: What is the difference between double quotes and single quotes in Javascript?
There are no differences from the programming point of view, even using Strict Mode ("use strict;") As pointed out by Carlos André, one approach is that you can put simple quotes inside the string…
javascriptanswered Gustavo Carvalho 461