Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: exports is not defined in scrollability.js | exports.directions = directions; #37

Open
jamshoo opened this issue Jan 18, 2013 · 5 comments

Comments

@jamshoo
Copy link

jamshoo commented Jan 18, 2013

//It seems scrollability hasn't been updated in a while, if you are using dropkick and jquery //this is what I had to do, edit on your scrollability.js file the following:

//Replace:
require.ready(function() {
document.addEventListener(isTouch ? 'touchstart' : 'mousedown', onTouchStart, false);
window.addEventListener('load', onLoad, false);
});

//For this:

$(document).ready(function(){
document.addEventListener(isTouch ? 'touchstart' : 'mousedown', onTouchStart, false);
window.addEventListener('load', onLoad, false);
});

and comment out line 77, 79 and 84 that start with 'export'.

@vicky8987
Copy link

Although I changed these lines, then too i am getting error
I want to add this code for dropkick scroll in mobile device.
fro reference: http://23.23.201.202/vikas/ds/ex.html
In mobile i am able to see only 8 items out of 30 without scroll.

http://stackoverflow.com/questions/13388821/dropkick-plugin-not-wroking-with-scrollability-mobile-scrolling

Please verify the code:

//exports.directions = directions;

//exports.flashIndicators = function() {
// var scrollables = document.querySelectorAll('.scrollable.vertical');
// for (var i = 0; i < scrollables.length; ++i) {
// exports.scrollTo(scrollables[i], 0, 0, 20, true);
// }
//}

function onLoad() {
var ss = document.createElement("style");
document.head.appendChild(ss);
globalStyleSheet = document.styleSheets[document.styleSheets.length-1];

// exports.flashIndicators();

}

//require.ready(function() {
document.addEventListener(isTouch ? 'touchstart' : 'mousedown', onTouchStart, false);
window.addEventListener('load', onLoad, false);

//});

I commented
1-> //exports.directions = directions;
2-> //exports.flashIndicators = function() {
and finally
3-> //require.ready(function() {

If not commenting getting error
1->ReferenceError: exports is not defined
exports.directions = directions;
2->ReferenceError: require is not defined
require.ready(function() {

I am use this with dropkick.js.

If there is any suggestion or link. Please help.

@jamshoo
Copy link
Author

jamshoo commented Feb 12, 2013

Here is my scrollability.js file download and replace it with yours
http://www.mediafire.com/?lpcuxuh49eecg75

@vicky8987
Copy link

Thanks Jamshoo, but problem still exist in mobile phones for dropkick.
http://23.23.201.202/vikas/ds/ex.html

@jamshoo
Copy link
Author

jamshoo commented Feb 12, 2013

I know it gives scroll problem on android but correctly works for iphone

@vicky8987
Copy link

Thanks alot jamshoo, your JS is working fine for iphone. and behaving abnormally with android as told by you. but if any chance, you can suggest something to do better for android. Thank in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants