Note that there are some explanatory texts on larger screens.

plurals
  1. POInclude iscrollview.js with RequireJS and jQuery Mobile
    primarykey
    data
    text
    <p>I'm slowly getting desperate on this one. I have a project where I use RequireJS to separate my JS code. I've managed to get this up and running, but now I'm having difficulties with the <a href="https://github.com/watusi/jquery-mobile-iscrollview" rel="nofollow">iscrollview</a> library. This provides an implementation of <a href="http://cubiq.org/iscroll-4" rel="nofollow">iScroll</a> to use in jQuery Mobile websites. Here is some code to sketch my situation:</p> <p>index.html:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;iscrollview&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link rel="stylesheet" type="text/css" href="js/lib/jquery-mobile/jquery.mobile-1.2.0.min.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="js/lib/iscrollview/iscrollview.css" /&gt; &lt;script type="text/javascript" data-main="js/main.js" src="js/lib/require/require-2.1.1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;Header&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;div data-iscroll&gt; &lt;!-- this contains some long content (long enough to trigger scrolling) --&gt; &lt;/div&gt; &lt;/div&gt; &lt;div data-role="footer"&gt; &lt;h2&gt;Footer&lt;/h2&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>js/main.js:</p> <pre><code>requirejs.config({ baseUrl: 'js', paths: { jquery: 'lib/jquery/jquery-1.8.2.min', jquerymobile: 'lib/jquery-mobile/jquery.mobile-1.2.0.min', iscroll: 'lib/iscroll/iscroll', iscrollview: 'lib/iscrollview/iscrollview' }, shim: { jquerymobile: { deps: ['jquery'] }, iscroll: { deps: ['jquerymobile'] }, iscrollview: { deps: ['iscroll'] } } }); requirejs(['jquery','jquerymobile','iscroll','iscrollview'], function($){ /* I would expect that the correct JS files are loaded by the time we get here, so the iscrollview.js should recognize the data-trim attribute which I've applied earlier in index.html but unfortunately this doesn't happen in this implementation. /* }); </code></pre> <p>I hope I've pointed out my problem well enough for you guys to have a go out. Really appreciate the effort you put in to it!</p> <p><strong>Edit:</strong></p> <p>You can find the (simplified) project <a href="https://rapidshare.com/files/470972654/iscrollview.zip" rel="nofollow">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload