This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| x=x+1; | |
| minusCount = minusCount - 1; | |
| y=y*10; | |
| //shorthand version | |
| x++; | |
| minusCount --; | |
| y*=10; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x; | |
| var y; | |
| var z = 3; | |
| //shorthand | |
| var x, y, z=3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var skillSet = new Array(); | |
| skillSet['Document language'] = 'HTML5'; | |
| skillSet['Styling language'] = 'CSS3'; | |
| skillSet['Javascript library'] = 'jQuery'; | |
| skillSet['Other'] = 'Usability and accessibility'; | |
| //short hand version | |
| var skillSet = { | |
| 'Document language' : 'HTML5', | |
| 'Styling language' : 'CSS3', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var a = new Array(); | |
| a[0] = "myString1"; | |
| a[1] = "myString2"; | |
| a[2] = "myString3"; | |
| //short hand version | |
| var a = ["myString1", "myString2", "myString3"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (variable1 !== null || variable1 !== undefined || variable1 !== '') { | |
| var variable2 = variable1; | |
| } | |
| //short hand | |
| var variable2 = variable1 || ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var big; | |
| if (x > 10) { | |
| big = true; | |
| } | |
| else { | |
| big = false; | |
| } | |
| //Short hand version | |
| var big = (x > 10) ? true : false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myLinkCollection = document.getElementsByTagName("a"); | |
| for (i=0;i<myLinkCollection.length;i++) { | |
| if (myLinkCollection[i].getAttribute("href")) { | |
| // do something with the anchor tags here | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| $(window).on("mousemove", mouseMoveHandler); | |
| function mouseMoveHandler(e) { | |
| var pos = e.clientY; | |
| console.log(pos); | |
| if (pos < 15) { | |
| //key take away, is once you've got the event you want to trigger, it's good to "Turn OFF" the listner | |
| $(window).off( "mousemove", mouseMoveHandler ); | |
| $(".footer-popup").animate({ | |
| bottom: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(window).on("mousemove", function (e) { console.log(e.clientY) }); | |
| $(window).on("mousemove", function (e) { console.log(e) }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .fullWH{ | |
| width: 100%; | |
| height: 323px; | |
| } | |
| #bg1 { | |
| background-image: url( "../img/bg1.png" ); | |
| } | |
| #bg2 { | |
| background-image: url( "../img/bg2.png" ); | |
| } |