Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added checkbox to toggle css transition to demo

  • Loading branch information...
commit 90649e1528460e7375b219170e6aa5ea3b1287c4 1 parent 3d25708
@Prinzhorn authored
Showing with 15 additions and 5 deletions.
  1. +13 −0 index.html
  2. +2 −5 skrollr.css
View
13 index.html
@@ -59,6 +59,11 @@
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></p>
</div>
+ <div style="position:fixed;right:0;top:0;padding:.5em;background:#fff;z-index:102;">
+ <input type="checkbox" name="cbTransition" id="cbTransition" />
+ <label for="cbTransition">Smooth scrolling</label>
+ </div>
+
<script type="text/javascript">
if(location.search === '?debug') {
document.write('<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"><' + '/script>');
@@ -84,6 +89,14 @@
}
}
});
+
+ document.getElementById('cbTransition').onchange = function() {
+ if(this.checked) {
+ document.body.className = '';
+ } else {
+ document.body.className = 'notransition';
+ }
+ };
</script>
</body>
View
7 skrollr.css
@@ -18,16 +18,13 @@ html, body {
z-index:100;
/*
- * Uncomment the transition part if you want.
- * For example Firefox 13 added smooth scrolling and you don't need transitions.
+ * Use with caution
*/
- /*
transition: all .3s;
- -o-transition: all .3s;
+ /*-o-transition: all .3s;*/
-ms-transition: all .3s;
-moz-transition: all .3s;
-webkit-transition: all .3s;
- */
}
.skrollable.notransition, .notransition .skrollable {
Please sign in to comment.
Something went wrong with that request. Please try again.