Comments (5)
Hi,
thanks for your response,
i guess this should work.
I will however look into the issue tough,
how does it come that the window width was the same value as the height?
Do you still have the complete example code wich did not work? Can i
take a look?
Thanks and best regards
Alex
Pixxelfactory
Am 02.06.14 12:17, schrieb Yuki Yoshida:
Thanks for the nice plugins!
I used this plugin with jQuery v1.11.1 but it didn't work at first.
It seemed
var scrollPercent = (currY / (totalHeight - winHeight)).toFixed(4);
returns "infinity" value because totalHeight and winHeight was same value.I changed the lines below in the plugin:
$([document, window]).on('ready resize', function (e) {
totalHeight = $(document).height();
winHeight = $(this).height();
winWidth = $(this).width();
});
to
$([document, window]).on('ready resize', function (e) {
totalHeight = $(document).height();
winHeight = $(window).height();
winWidth = $(window).width();
});and now it worked.
Was it way to go or it will lead another issue?
I hope it still helps.—
Reply to this email directly or view it on GitHub
#10.
from jinvertscroll.
I just downloaded files from this repository and tried the example with jQuery v1.11.1 instead of v1.10.2 which comes with the example.
how does it come that the window width was the same value as the height?
Not "width" and "height" are the same. "totalHeight" and "winHeight" is the same here.
It seems
$(this).height();
is the issue.
It returns different values between when I try with jQuery v1.11.1 and v1.10.2.
When I try v1.10.2, it returns a correct window height, however, in v1.11.1 it returns same value as $(document).height().
As a result,
var scrollPercent = (currY / (totalHeight - winHeight)).toFixed(4);
console.log(scrollPercent);
returns "infinity", and makes the library not work.
After I manually changed the size of window, it starts working.
My browser is Chrome 35.0.1916.114.
Cheers,
Yuki
from jinvertscroll.
It seems that jQuery 1.11 also gets the document height when using
$(this).height()...
However, i tested your solution and applied it to the repo, i also added
a check if the window-height == document-height,
set the scrollPercent Variable to 0 manually instead of dividing by 0.
Thanks again for reporting the bug and providing a solution.
I obviously mentioned you in the commit.
Cheers
Alex
Pixxelfactory
Am 03.06.14 11:57, schrieb Yuki Yoshida:
I just downloaded files from this repository and tried the example
with jQuery v1.11.1 instead of v1.10.2 which comes with the example.how does it come that the window width was the same value as the height? Not "width" and "height" are the same. "totalHeight" and "winHeight" is the same here.
It seems
$(this).height();
is the issue.It returns different values between when I try with jQuery v1.11.1 and
v1.10.2.When I try v1.10.2, it returns a correct window height, however, in
v1.11.1 it returns same value as $(document).height().As a result,
var scrollPercent = (currY / (totalHeight - winHeight)).toFixed(4);
console.log(scrollPercent);
returns "infinity", and makes the library not work.After I manually changed the size of window, it starts working.
My browser is Chrome 35.0.1916.114.
Cheers,
Yuki—
Reply to this email directly or view it on GitHub
#10 (comment).
from jinvertscroll.
Cool!
It's nice that I can by somehow contribute a little bit for this great plugin.
Thanks again too for your nice plugin!
Cheers,
Yuki
from jinvertscroll.
You're welcome =)
So let's close this issue ;-)
Cheers
from jinvertscroll.
Related Issues (20)
- Typo on website HOT 3
- Start scrolling at a given point only HOT 6
- How can i implement smooth scrolling. HOT 7
- How to implement waypoint horizontal navigation with jInvertScroll ? HOT 15
- Bower package HOT 1
- Callback Function on init HOT 2
- Different "Scenes"
- How to fix on mobile ? HOT 9
- anchors issue
- Creating 'Next' and 'Prev' links
- Start scroll in middle of page
- how to 'stop' the inverse scroll HOT 1
- How do I vertical align my content? HOT 1
- Scroll Bar position HOT 3
- how to implement it in wordpress HOT 1
- Body Height HOT 1
- Mouse click and drag to scroll
- Elementoffset scroll to the center of the element
- Slow performance on ipad HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jinvertscroll.