Coder Social home page Coder Social logo

Comments (5)

pixxelfactory avatar pixxelfactory commented on August 12, 2024

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.

yukiy avatar yukiy commented on August 12, 2024

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.

pixxelfactory avatar pixxelfactory commented on August 12, 2024

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.

yukiy avatar yukiy commented on August 12, 2024

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.

pixxelfactory avatar pixxelfactory commented on August 12, 2024

You're welcome =)
So let's close this issue ;-)

Cheers

from jinvertscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.