Skip to content

Instantly share code, notes, and snippets.

@NatalieMac
Created December 9, 2015 06:14
Show Gist options
  • Save NatalieMac/f5de36c080ebaa3f973e to your computer and use it in GitHub Desktop.
Save NatalieMac/f5de36c080ebaa3f973e to your computer and use it in GitHub Desktop.
$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