Skip to content

Instantly share code, notes, and snippets.

@frankie-loves-jesus
Created July 21, 2014 18:41
Show Gist options
  • Save frankie-loves-jesus/7b9498bdf845a80878e8 to your computer and use it in GitHub Desktop.
Save frankie-loves-jesus/7b9498bdf845a80878e8 to your computer and use it in GitHub Desktop.
[data-iscroll] .scroller_wrapper { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transform: translateZ(0); }
[data-iscroll] .scroller { position: relative; }
$(document).on('pagecontainershow', function() {
$('[data-iscroll]').each(function() {
$(this).wrapInner("<div class='scroller'></div>")
.wrapInner("<div class='scroller_wrapper'></div>");
var wrapper = $(this).find('.scroller_wrapper').first(),
windowHeight = $(window).height();
wrapper.height(windowHeight);
var scrollerTest = new IScroll(wrapper.get(0), {
eventPassthrough: false,
scrollX: false,
scrollY: true,
preventDefault: false,
scrollbars: true
});
});
document.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
});
source 'https://rails-assets.org'
gem 'rails-assets-jquery-mobile-bower'
gem 'rails-assets-iscroll', '5.1.2'
<div class="test" data-iscroll>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment