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

How to stop the plugin on device width? #743

Closed
crazyboy24 opened this issue Sep 30, 2014 · 9 comments
Closed

How to stop the plugin on device width? #743

crazyboy24 opened this issue Sep 30, 2014 · 9 comments

Comments

@crazyboy24
Copy link

Hey,

I am building an one page website, and I am using Fullpage.js.
I want that when the device width is less than 580px, the plugin stops to work and normal scrolling begin.
I am using this code for that but it is not working:

<script> $(document).ready(function(){ $(window).resize(function(){ if ($("#home-text-responsiveness").css("font-size") == "40px" ){ $("#fullpage").fullpage().stop(); } }); }); </script>

I have a three column container and want that when the device width is <= 768px those column turn into slider using Fullpage.js slider functionality.

Any help regarding this?

@alvarotrigo
Copy link
Owner

Please read this answer.

This is about responsive design, not really about fullpage.js

@alvarotrigo
Copy link
Owner

Also this another one.

@crazyboy24
Copy link
Author

ok. thanks

@crazyboy24
Copy link
Author

And one more thing, in onepage-scroll there is an option of updateurl as true or false, can I do that using this plugin.

@alvarotrigo
Copy link
Owner

If you read the documentation you will see there's an option for it called anchors. If you don't add it, the URL will be static. You even have an example on the demo page.

@crazyboy24
Copy link
Author

Ok. I followed your link about responsive design, and it worked with not showing if the screen is less than 480px, but the second part, i.e I want to add the 'slide' when the screen is more than 480 but less than 768px. This is my code:

<script>
$(document).ready(function(){
  var window_width = $(window).width();
  $(window).resize(function() {
  if ($(this).width() <=480) {
    return;
  }
else if ($(this).width() <= 768) {
  $('#fullpage').fullpage({
    verticalCentered: false,
    resize : true,
    anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage',],
    scrollingSpeed: 1500,
    easing: 'easeOutQuad',
    menu: '.navbar-fixed-top',
    slidesNavigation: true,
    slidesNavPosition: 'bottom',
    loopBottom: false,
    loopTop: false,
    loopHorizontal: true,
    autoScrolling: true,
    scrollOverflow: true,
    css3: false,
    normalScrollElementTouchThreshold: 5,
    keyboardScrolling: true,
    touchSensitivity: 15,
    continuousVertical: false,
    animateAnchor: true,
    sectionSelector: '.section',
    slideSelector: '.slide',

});
}
else if (window_width > 768) {
$('#fullpage').fullpage({
verticalCentered: false,
resize : true,
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage',],
scrollingSpeed: 1500,
easing: 'easeOutQuad',
menu: '.navbar-fixed-top',
loopBottom: false,
loopTop: false,
autoScrolling: true,
scrollOverflow: true,
css3: false,
normalScrollElementTouchThreshold: 5,
keyboardScrolling: true,
touchSensitivity: 15,
continuousVertical: false,
animateAnchor: true,
sectionSelector: '.section',
});
}
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$(window).resize();
});

Can you help me with this please.

@crazyboy24
Copy link
Author

Can you help me with this please

@alvarotrigo
Copy link
Owner

You should ask in another forum. This forum is to treat fullpage.js issues or questions
Yours is a question about javascript or jQuery.

@tomByrer
Copy link
Contributor

tomByrer commented Oct 1, 2014

You should ask in another forum.

#617

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

No branches or pull requests

3 participants