Skip to content

Commit

Permalink
Merge pull request #83 from XhmikosR/master
Browse files Browse the repository at this point in the history
Update test/index.html
  • Loading branch information
brandonaaron authored and kadoshms committed Oct 2, 2021
1 parent 66db7be commit e3e276b
Showing 1 changed file with 27 additions and 35 deletions.
62 changes: 27 additions & 35 deletions packages/jquery-mousewheel/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,87 +4,64 @@
<meta charset="iso-8859-1">
<title>Testing mousewheel plugin</title>

<script>
(function() {
var verMatch = /v=([\w\.]+)/.exec(location.search),
version = verMatch && verMatch[1],
src;
if (version)
src = 'code.jquery.com/jquery-' + version;
else
src = 'code.jquery.com/jquery-git';
document.write('<script src="http://' + src + '.js"><\/script>');
})();
</script>
<script src="../jquery.mousewheel.js"></script>

<style>
html {
font: 13px Arial, sans-serif;
}

#stage {
color: #fff;
position: relative;
zoom: 1;
}

#test1, #test2, #test3, #test4, #test5, #test6, #test7 {
float: left;
}

#test1 {
background-color: #000;
width: 120px;
height: 100px;
color: #fff;
float: left;
}

#test2 {
background-color: #333;
width: 120px;
height: 100px;
color: #fff;
float: left;
}

#test3 {
background-color: #666;
width: 120px;
height: 100px;
color: #fff;
float: left;
}

#test4 {
background-color: #000;
width: 120px;
height: 100px;
color: #fff;
float: left;
}

#test5 {
background-color: #333;
padding: 5px;
width: 400px;
height: 400px;
color: #fff;
float: left;
}

#test6 {
background-color: #666;
padding: 5px;
width: 250px;
height: 250px;
color: #fff;
float: left;
}

#test7 {
background-color: #000;
padding: 5px;
width: 100px;
height: 100px;
color: #fff;
float: left;
}

#forceScroll {
Expand All @@ -103,6 +80,7 @@
}

#logger p {
color: #000;
padding: 2px;
border-bottom: 1px solid #ccc;
margin: 0;
Expand All @@ -116,6 +94,19 @@
border-bottom-color: #000;
}
</style>

<script>
(function() {
var verMatch = /v=([\w\.]+)/.exec(location.search),
version = verMatch && verMatch[1],
src;
if (version)
src = 'code.jquery.com/jquery-' + version;
else
src = 'code.jquery.com/jquery-git';
document.write('<script src="http://' + src + '.js"><\/script>');
})();
</script>
<script>
$(function() {
$('#userAgent').html(navigator.userAgent);
Expand Down Expand Up @@ -147,13 +138,13 @@
};

$('#test1')
.mousewheel(function(event, delta, deltaX, deltaY) {
.mousewheel(function(event, delta) {
loghandle(event, delta);
log('pageX: ' + event.pageX + ' pageY: ' + event.pageY );
});

$('#test2')
.mousewheel(function(event, delta, deltaX, deltaY) {
.mousewheel(function(event, delta) {
loghandle(event, delta);
return false; // prevent default
});
Expand All @@ -170,33 +161,33 @@
};

$('#test4')
.mousewheel(function(event, delta, deltaX, deltaY) {
.mousewheel(function(event, delta) {
loghandle(event, delta);
return false;
})
.mousewheel(testRemoval)
.mousewheel(function(event, delta, deltaX, deltaY) {
.mousewheel(function(event, delta) {
loghandle(event, delta);
return false;
})
.unmousewheel(testRemoval);

$('#test5')
.mousewheel(function(event, delta, deltaX, deltaY) {
.mousewheel(function(event, delta) {
loghandle(event, delta);
event.stopPropagation();
event.preventDefault();
});

$('#test6')
.mousewheel(function(event, delta, deltaX, deltaY) {
.mousewheel(function(event, delta) {
loghandle(event, delta);
event.stopPropagation();
event.preventDefault();
});

$('#test7')
.mousewheel(function(event, delta, deltaX, deltaY) {
.mousewheel(function(event, delta) {
loghandle(event, delta);
event.preventDefault();
});
Expand All @@ -206,6 +197,7 @@
}
});
</script>
<script src="../jquery.mousewheel.js"></script>
</head>
<body>
<h1 id="banner">jQuery mousewheel.js Test with jQuery <span id="jqueryVersion"></span></h1>
Expand Down

0 comments on commit e3e276b

Please sign in to comment.