Code Monkey home page Code Monkey logo

jscroll's People

Contributors

bradcrawford avatar wduffy avatar wezm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jscroll's Issues

Cancel scrolling when browser is resized to a specific dimension

This is not so much an issue, but more of a feature request.

Is there any way for the plugin to ONLY scroll if the $(window).width() method returns a value higher than X, so that if a browser is resized to say, a mobile size (i.e. using a responsive design), the scrolling will not happen.

Example:
I have a sidebar and a content area. Sidebar currently scrolls with the content. When I resize the window to be really small, I stack sidebar and content area on top of each other so now the sidebar doesn't need to scroll.

The result at the moment is that you scroll, and then jScroll scrolls again which is obviously not desirable.

Any ideas? (Thanks for creating a great little plugin).

Performance, CSS only solution?

Hi there,

thanks for the plugin.

Do you thin its possible to solve the positioning via css only (The performance should be better, when the margin is not calculated on each scroll).

The idea is, to assign to the element the style "position:fixed" after a certain offset. In this case, the browser manages the positioning of the element. To "stop" the element before a footer for example, it could be set to position:absolute with top: theCurrentOffsetFromTop.

What do you think of that and do you can help me a little bit with that?

Thanks!
florian

strange issue

Thank you for the wonderful plugin.
I use it on a wordpress site to move the widgets elements (I just move the first one and the others below follow it as the plugin just add a margin-top)

It works for 90% time, BUT sometimes totally randomly, the element start to scroll BEFORE the window's top reach it and I need to do a refresh on the page to make it run as intended.

I also have the same problem as others on parent size when it's not set in the CSS, the elements push down the footer when reaching the bottom page. Indefinitely.

unset height of div : possible bug

Browser in Question: FF v 3.5.4, Safari v 5.0.1, Opera v 11.5
OS: Mac OS X 10.5.8

Issue:

In the event that the container div does not have a height set in css the plugin will currently scroll the scrollable div down infinitely by expanding the container div infinitely. Is there a way to keep the scrollable div from expanding the containing div, or maybe including some settings so that we can eliminate the expansion by setting {container_expansion: false}?

This is a dynamically built site so the divs for both the scrolling div and the container div have variable heights depending on the page displayed. If you need an example just message me and I can send you a link.

Chrome v 13.0.782.215 does not seem to have this issue

scoll onload

    return this.each(function() {
        var $element = $(this);
        var $window = $(window);
        var locator = new location($element);

        $window.scroll(function() {
            $element
                .stop()
                .animate(locator.getMargin($window), opts.speed);
        }).scroll();
    });

by adding the .scroll(); after the callback is defined will enable the callback to be executed instantly. This will allow the plugin to work when someone has used the back button in a browser and it loads already scrolled down a page.

Currently this will only bring the element into view when the user scrolls. The extra .scroll() will enable it to come in on load.

Scroll goes negative on margin

When the parent doesn't have the height set (which with floating elements could happen), or when the height of the parent is smaller than the moving elem, the plugin comes with a negative margin.

To solve this, add this validation on the "getMargin" closure (line 63 on my version):
if(max < this.originalMargin)
max = this.originalMargin;

"undo" $(".myDiv).jScroll()

This is not really an issue, but more of a feature request, or question. I use a simple function comparing the div height and the window height to determine if $(".myDiv").jScroll(); should be used or not. It works until the window is resized. To fix this I run the function on $(window).resize, which helps, but I still have an issue when resizing from the allowed scroll height to the unallowed scroll height... I believe I just need to "undo" the initial $(".myDiv").jScroll() at the beginning of my function and run the comparison logic again. Long story short, is there a way to "undo" $(".myDiv").jScroll() after it has already been run?

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.