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

Page height not variable + scroll to top? #116

Open
zinzy opened this issue Sep 20, 2012 · 5 comments
Open

Page height not variable + scroll to top? #116

zinzy opened this issue Sep 20, 2012 · 5 comments
Labels

Comments

@zinzy
Copy link

zinzy commented Sep 20, 2012

  1. I'd love to be able to scroll to the top of the next slide when swiping left to right
  2. I'd also love to have each slide be of variable height (right now the shorter slides have giant blank spaces below them; all the slides are the same height as the longest slide)

Thank you so much in advance!

@docpaco
Copy link

docpaco commented Jan 29, 2013

Hi,

I'm trying to resolve those two points too !
Have you found any solution?

Many thanks in advance!
Paco

@ericmillsio
Copy link

I am interested in this too. Have either of you resolved this?

It may be difficult since he defines the pages as table cells, so they will conform to that and act like a big table. This may make both of these features rather difficult to accomplish.

@docpaco
Copy link

docpaco commented Feb 21, 2013

nope, still not!
but still trying...

@dan-johnston
Copy link

I solved it like this:

    var slider = document.getElementById('slider'),
        $slider = $(slider);

    // Adjust height according to first slide.
    $slider.height($slider.find("img:eq(0)").attr("height"));

    // https://github.com/bradbirdsall/Swipe
    var swipe = new Swipe(slider), {
        speed: 350,
        callback: function(index, elem) {
            $slider.animate({"height": $(elem).height()}, 350, 'easeInOutQuint');
        }
    });

This isn't a great responsive solution tho, it will fail for images resized by the browser. We'll have to wait until there is a Swipe.init() (or similar) callback, See issue #166.

@kylethrock
Copy link

I used jquery to great a function that reset the slider back to the top.

<script> $(document).ready(function() { $('#reset').click(function() { $('#mySwipe').animate({ scrollTop: '00' }, 0); }); }); </script>

then on my html I labeled my button id="reset"

prev

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

No branches or pull requests

5 participants