Last active
August 29, 2015 14:07
-
-
Save raldred/9d25e968a9f13c923d5e to your computer and use it in GitHub Desktop.
// source http://jsbin.com/qehuna
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.13.2/TweenMax.min.js"></script> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.map { | |
position: relative; | |
transform-origin: top left; | |
} | |
h2 { | |
position: absolute; | |
z-index: 2; | |
font-size: 4em; | |
} | |
img { | |
position: absolute; | |
z-index: 1; | |
left: -15em; | |
top: -15em; | |
width: 30em; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="map"> | |
<h2>Title</h2> | |
<img src="http://i.imgur.com/OSTaqeW.jpg"> | |
</div> | |
<script id="jsbin-javascript"> | |
var zoomed = false; | |
$('.map').on('click',function(e) { | |
var scale = zoomed ? 1 : 2; | |
TweenMax.to(e.delegateTarget,1,{ | |
scaleX: scale, | |
scaleY: scale, | |
force3D: true | |
}); | |
zoomed = !zoomed; | |
}); | |
</script> | |
</body> | |
</html> |
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
.map { | |
position: relative; | |
transform-origin: top left; | |
} | |
h2 { | |
position: absolute; | |
z-index: 2; | |
font-size: 4em; | |
} | |
img { | |
position: absolute; | |
z-index: 1; | |
left: -15em; | |
top: -15em; | |
width: 30em; | |
} |
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 zoomed = false; | |
$('.map').on('click',function(e) { | |
var scale = zoomed ? 1 : 2; | |
TweenMax.to(e.delegateTarget,1,{ | |
scaleX: scale, | |
scaleY: scale, | |
force3D: true | |
}); | |
zoomed = !zoomed; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment