Skip to content

Instantly share code, notes, and snippets.

@callblueday
Last active December 21, 2015 15:28
Show Gist options
  • Save callblueday/6326509 to your computer and use it in GitHub Desktop.
Save callblueday/6326509 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript">
var count = 10;
function Picture()
{
if (event.wheelDelta >= 120)
Resize(++count);
else if (event.wheelDelta <= -120)
Resize(--count);
return false;
}
function Resize(c){
oImage.style.zoom = c + '0%';
}
</script>
</head>
<body>
<img id="oImage" src="Sample.png" alt="sample "onmousewheel="Picture()">
</body>
</html>
http://msdn.microsoft.com/en-us/library/ie/ms536951(v=vs.85).aspx<html>
<head>
<script type="text/javascript">
var count = 10;
function Picture()
{
if (event.wheelDelta >= 120)
Resize(++count);
else if (event.wheelDelta <= -120)
Resize(--count);
return false;
}
function Resize(c){
oImage.style.zoom = c + '0%';
}
</script>
</head>
<body>
<img id="oImage" src="Sample.png" alt="sample "onmousewheel="Picture()">
</body>
</html>
http://msdn.microsoft.com/en-us/library/ie/ms536951(v=vs.85).aspx
@callblueday
Copy link
Author

// other browsers mousewheel events

$(window).bind('mousewheel', function(event, delta, deltaX, deltaY) {
// if(document.body.offsetWidth >= 800 && !wait) {
if(!wait) {
wait = true;
if(delta < 0) {
//wheel down
whellDirection = 'down';
setPageDownEvent(area);
}
else {
//wheel up
whellDirection = 'up';
setPageUpEvent(area);
}
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment