Skip to content

Commit

Permalink
Improved Firefox support
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Longo committed Feb 17, 2012
1 parent 590f91a commit 8256e12
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/demo1.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- Shared Scripts -->
<script src="../libs/modernizr-2.0.6.min.js"></script>
<script src="../libs/zepto.min.js"></script>
<script src="../src/zepto.flickable.js"></script>
<script src="../src/zepto.flickable.min.js"></script>
<script src="js/demo.js"></script>

<!-- Demo 1 Scripts -->
Expand Down Expand Up @@ -145,7 +145,7 @@

<div class="demo-intro" id="demo1-intro">
<h1>Demo 1: Flicking between screens</h1>
<p>This demo allows you to swipe between 'cards' within a set area. Tap a card to flip it around.</p>
<p>This demo allows you to swipe between 'cards' within a set area. Tap a card to flip it around (flipping cards works only in webkit browsers).</p>
</div>


Expand Down
2 changes: 1 addition & 1 deletion examples/demo2.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- Shared Scripts -->
<script src="../libs/modernizr-2.0.6.min.js"></script>
<script src="../libs/zepto.min.js"></script>
<script src="../src/zepto.flickable.js"></script>
<script src="../src/zepto.flickable.min.js"></script>
<script src="js/demo.js"></script>

<!-- Demo 1 Scripts -->
Expand Down
2 changes: 1 addition & 1 deletion examples/demo3.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- Shared Scripts -->
<script src="../libs/modernizr-2.0.6.min.js"></script>
<script src="../libs/zepto.min.js"></script>
<script src="../src/zepto.flickable.js"></script>
<script src="../src/zepto.flickable.min.js"></script>
<script src="js/demo.js"></script>

<!-- Demo 1 Scripts -->
Expand Down
10 changes: 8 additions & 2 deletions src/zepto.flickable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Licensed under the Whatever License. Use it for whatever you want!
*
* @author [email protected]
* @version 1.0.2
* @version 1.0.3
*
* @requires
* Zepto JavaScript Library
Expand Down Expand Up @@ -271,7 +271,13 @@
(d == 'y') ? style = '(0,'+pos+'px,0)' : style = '('+pos+'px,0,0)';

// Zepto does not currently support setting translate3d via .css() so we have to do it manually
document.getElementById(el.attr('id')).style.webkitTransform = 'translate3d'+style;
if(typeof document.getElementById(el.attr('id')).style.webkitTransform != 'undefined') {
document.getElementById(el.attr('id')).style.webkitTransform
} else if (typeof document.getElementById(el.attr('id')).style.mozTransform != 'undefined') {
document.getElementById(el.attr('id')).style.mozTransform = 'translate3d'+style;
} else {
document.getElementById(el.attr('id')).style.transform = 'translate3d'+style;
}

}

Expand Down
4 changes: 2 additions & 2 deletions src/zepto.flickable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8256e12

Please sign in to comment.