Skip to content

Commit 6bcf241

Browse files
committed
Adding Modernizr touch detection and disable sticky scroll if touch
1 parent 5e23619 commit 6bcf241

9 files changed

Lines changed: 20 additions & 8 deletions

File tree

‎download/index.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<meta name="Description" content="Processing is an electronic sketchbook for developing ideas. It is a context for learning fundamentals of computer programming within the context of the electronic arts." />
5151
<meta name="Copyright" content="All contents copyright Ben Fry, Casey Reas, MIT Media Laboratory" />
5252

53+
<script src="/javascript/modernizr-2.6.2.touch.js"></script>
5354
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
5455
<script>window.jQuery || document.write('<script src="/javascript/jquery-1.9.1.min.js"><\/script>')</script>
5556
<script src="/javascript/site.js" type="text/javascript"></script>

‎java_generate/templates/class.template.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
within the context of the electronic arts." />
1616
<meta name="Copyright" content="All contents copyright Ben Fry, Casey Reas, MIT Media Laboratory" />
1717

18-
<!-- ======== change the style link back later ============= -->
18+
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
1919
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
2020

2121
</head>

‎java_generate/templates/generic.template.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
within the context of the electronic arts." />
1616
<meta name="Copyright" content="All contents copyright Ben Fry, Casey Reas, MIT Media Laboratory" />
1717

18+
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
1819
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
1920

2021
</head>

‎java_generate/templates/index.alphabetical.template.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
within the context of the electronic arts." />
1616
<meta name="Copyright" content="All contents copyright Ben Fry, Casey Reas, MIT Media Laboratory" />
1717

18+
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
1819
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
1920

2021
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

‎java_generate/templates/index.template.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
within the context of the electronic arts." />
1616
<meta name="Copyright" content="All contents copyright Ben Fry, Casey Reas, MIT Media Laboratory" />
1717

18+
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
1819
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
1920

2021

‎java_generate/templates/library.index.template.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
within the context of the electronic arts." />
1616
<meta name="Copyright" content="All contents copyright Ben Fry, Casey Reas, MIT Media Laboratory" />
1717

18+
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
1819
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
1920

2021
</head>

‎javascript/modernizr-2.6.2.touch.js‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎javascript/site.js‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
$(function(){
22

33
// sticky scroll
4-
$(window).scroll(function(){
5-
if($(this).scrollTop() < 114){
6-
$('.navBar').removeClass('stuck')
7-
} else {
8-
$('.navBar').addClass('stuck')
9-
}
10-
})
4+
if(!Modernizr.touch){
5+
$(window).scroll(function(){
6+
if($(this).scrollTop() < 114){
7+
$('.navBar').removeClass('stuck')
8+
} else {
9+
$('.navBar').addClass('stuck')
10+
}
11+
})
12+
}
1113

1214
// if on the homepage, gather recent tweets/commits
1315
if($('body').attr('id')=='Cover'){

‎templates/template.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
within the context of the electronic arts." />
1515
<meta name="Copyright" content="All contents copyright Ben Fry, Casey Reas, MIT Media Laboratory" />
1616

17+
<script src="<!--*-->relpath<!--*-->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
1718
<link href="<!--*-->relpath<!--*-->css/style.css" rel="stylesheet" type="text/css" />
1819
</head>
1920
<body id="<!--*-->bodyid<!--*-->" onload="" >

0 commit comments

Comments
 (0)