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

Disable scroll when refresh (F5) triggered #50

Closed
aguieb opened this issue Nov 24, 2011 · 5 comments
Closed

Disable scroll when refresh (F5) triggered #50

aguieb opened this issue Nov 24, 2011 · 5 comments

Comments

@aguieb
Copy link

aguieb commented Nov 24, 2011

I have the following...

$('#slider-two').movingBoxes({
startPanel : 1,
width : 500,
wrap : false,
panelWidth : .7,
buildNav : true,
navFormatter : function(index, panel){ return panel.find('h2 span').text(); }
});

When I click on the F5 button I don't see the scroll animation.
But when I change the wrap variable to "true" and I click F5, I see the scroll animation run. How do I turn off the default scroll animation when F5 or page is loaded? I like it when I don't see the animation run by default.

Please advice.

thanks!

@Mottie
Copy link
Contributor

Mottie commented Nov 24, 2011

I'm not quite sure what you are asking... pressing f5 reloads the page. So are you talking about the initial scrolling that MovingBoxes does? Have you tried setting the hashTags to false? Doing that will prevent the URL from updating with the current slide and thus, the slider should start on the first panel, or which ever panel you have set as the startPanel.

Are you wanting to completely disable the initial scrolling?

@aguieb
Copy link
Author

aguieb commented Nov 24, 2011

Yes I am talking about the initial scrolling that MovingBoxes does when the page reloads when the wrap is set to true. I want to completely disable the initial scrolling. I tried setting the hashTags to false but it still scrolled on page load. When wrap variable is set to false the initial scrolling does not occur on page load. So I am trying to see we can disable the initial scroll when wrap is set to true. Thanks for replying so fast!

@Mottie
Copy link
Contributor

Mottie commented Nov 24, 2011

Ah ok, I understand. Try these settings (demo)

$('#slider').movingBoxes({

    // animation time in milliseconds
    speed: 0,

    // e = event, slider = MovingBoxes Object, tar = current panel #
    // callback when MovingBoxes has completed initialization
    initialized: function(e, slider, tar){
        slider.options.speed = 500;
    }

});

@aguieb
Copy link
Author

aguieb commented Nov 24, 2011

Thank you! Your suggestion works. Once again thank you for your prompt response on all my questions.

@aguieb aguieb closed this as completed Nov 24, 2011
@Mottie
Copy link
Contributor

Mottie commented Jan 10, 2012

Update: A new option named initAnimation was added in version 2.2.3. When set to false, MovingBoxes will initialize on the set startingPanel or hash tag panel without animation The above code is no longer needed.

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

No branches or pull requests

2 participants