Created
December 9, 2015 06:14
-
-
Save NatalieMac/f5de36c080ebaa3f973e to your computer and use it in GitHub Desktop.
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
$this.on('mouseover touchstart mouseout touchend click focus blur keypress', function(e) { | |
var type = e.type; | |
e.preventDefault(); | |
switch (type) { | |
case 'touchstart': | |
mapOver($this, img, type); | |
mapClick($this, img); | |
break; | |
case 'touchend': | |
// mapOut($this,img); | |
break; | |
case 'mouseout': | |
case 'blur': | |
mapOut($this, img); | |
break; | |
case 'mouseover': | |
case 'focus': | |
mapOver($this, img); | |
break; | |
case 'click': | |
case 'keypress': | |
if (trigger == 'click') { | |
mapClick($this, img); | |
} | |
if (e.which === 13) { | |
mapClick($this, img); | |
} | |
break; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment