This file contains 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
<!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ --> | |
<style type="text/css"> | |
.no-fouc {display: none;} | |
</style> | |
<script type="text/javascript"> | |
document.documentElement.className = 'no-fouc'; | |
// add to document ready: $('.no-fouc').removeClass('no-fouc'); | |
</script> |
This file contains 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 $window = $(window); //Window object | |
var scrollTime = 1.2; //Scroll time | |
var scrollDistance = 270; //Distance. Use smaller value for shorter scroll and greater value for longer scroll | |
$window.on("mousewheel DOMMouseScroll", function(event){ | |
event.preventDefault(); | |
var delta = event.originalEvent.wheelDelta/120 || -event.originalEvent.detail/3; |
This file contains 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
//TOUCH EVENTS | |
polyfillRequestAnimFrame(window); | |
var touchDragX = 0; | |
var lastTouchX = 0; | |
var sliderapi = null; | |
function onTouchStart (event) { | |
touchDragX = 0; | |
var touchPos = getTouchPos(event); |
This file contains 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
.roundcorners { position: relative; top: 0; left: 0; } | |
.oldIE .roundcorners { overflow: visible; } | |
.roundcornersInnerWrap { position: relative; top: 0; left: 0; } | |
.roundcorners .insideW { background-image:url("../images/corners/cornerWhiteInside.png"); } | |
.roundcorners .outsideW { background-image:url("../images/corners/cornerWhiteOutside.png"); } | |
.roundcorners .outsideWNoBdr { background-image:url("../images/corners/cornerWhiteOutsideNoBdr.png"); } | |
.roundcorners .outsideB { background-image:url("../images/corners/cornerBlackOutside.png"); } | |
.roundcorners .roundcorner { position: absolute; z-index: 1000; display: block; height: 10px; width:10px; } | |
.roundcorners .rcLeft.rcTop { left: 0; right: auto; top: 0; bottom: auto; background-position: left top; } | |
.roundcorners .rcRight.rcTop { left: auto; right: 0; top: 0; bottom: auto; background-position: right top; } |
This file contains 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 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
//1 | |
function Car(make, model, year, owner) { | |
this.make = make; | |
this.model = model; | |
this.year = year; | |
this.owner = owner; | |
//Notice the use of this to assign values to the object's properties based on the values passed to the function. | |
} | |
//2 |
This file contains 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
//create the object with properties & values. | |
var myCar = new Object(); | |
myCar.make = "Ford"; | |
myCar.model = "Mustang"; | |
myCar.year = 1969; | |
//then LOOP(enumerate) through all the properties of the object myCar | |
function showProps(obj, objName) { | |
var result = ""; | |
for (var i in obj) { |
This file contains 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 myHonda = {color: "red", wheels: 4, engine: {cylinders: 4, size: 2.2}}; | |
//console edits and results | |
myHonda.color | |
"red" | |
myHonda.engine | |
Object {cylinders: 4, size: 2.2} | |
myHonda.engine.size | |
2.2 | |
myHonda.engine.size = "3.3" |
OlderNewer