Skip to content

Commit

Permalink
Merge pull request #221 from mlhDevelopment/continuousVertical
Browse files Browse the repository at this point in the history
-Added new feature: continuous vertical scrolling by using the option `continuousVertical`
  • Loading branch information
alvarotrigo committed Feb 9, 2014
2 parents 607fe0a + ad04b53 commit 02746ef
Show file tree
Hide file tree
Showing 12 changed files with 289 additions and 34 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ $(document).ready(function() {
normalScrollElements: '#element1, .element2',
keyboardScrolling: true,
touchSensitivity: 15,
continuousVertical: false,

//events
onLeave: function(index, direction){},
Expand Down Expand Up @@ -176,6 +177,8 @@ It requieres [jQuery UI](https://jqueryui.com/) for using some of its transitions

- `touchSensitivity`: (default `5`) Defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section / slide

- `continuousVertical`: (default `false`) Defines whether scrolling down in the last section should scroll down to the first one or not, and if scrolling up in the first section should scroll up to the last one or not. Not compatible with `loopTop` or `loopBottom`.

- `menu`: (default `false`) A selector can be used to specify the menu to link with the slides. This way the scrolling of the slides will activate the corresponding element in the menu using the class `active`.
This won't generate a menu but will just add the `active` class to the element in the given menu with the corresponding anchor links.
In order to link the elements of the menu with the slides, an HTML 5 data-tag (`data-menuanchor`) will be needed to use with the same anchor links as
Expand Down
2 changes: 2 additions & 0 deletions examples/backgrounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>

<div class="section " id="section0"><h1>fullPage.js</h1></div>
Expand Down
2 changes: 2 additions & 0 deletions examples/callback.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>


Expand Down
82 changes: 82 additions & 0 deletions examples/continuous.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Continuous Scroll - fullPage.js</title>
<meta name="author" content="Matthew Howell" />
<meta name="description" content="fullPage continuous scrolling demo." />
<meta name="keywords" content="fullpage,jquery,demo,scroll,loop,continuous" />
<meta name="Resource-type" content="Document" />


<link rel="stylesheet" type="text/css" href="../jquery.fullPage.css" />
<link rel="stylesheet" type="text/css" href="demoPage.css" />

<!--[if IE]>
<script type="text/javascript">
var console = { log: function() {} };
</script>
<![endif]-->

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>

<script type="text/javascript" src="../jquery.fullPage.js"></script>
<script type="text/javascript" src="examples.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var pepe = $.fn.fullpage({
slidesColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', 'whitesmoke', '#ccddff'],
anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', 'lastPage'],
menu: '#menu',
continuousVertical: true
});
});
</script>

</head>
<body>


<select id="demosMenu">
<option id="background" selected>Choose Demo</option>
<option id="background">Background Images</option>
<option id="looping">Looping</option>
<option id="noAnchor">No anchor links</option>
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>


<ul id="menu">
<li data-menuanchor="firstPage" class="active"><a href="#firstPage">First slide</a></li>
<li data-menuanchor="secondPage"><a href="#secondPage">Second slide</a></li>
<li data-menuanchor="3rdPage"><a href="#3rdPage">Third slide</a></li>
</ul>


<div class="section " id="section0">
<h1>fullPage.js</h1>
<p>Continuous Scrolling Enabled</p>
<img src="imgs/fullPage.png" alt="fullPage" />
</div>
<div class="section" id="section1">
<div class="intro">
<h1>Around the world scrolling</h1>
<p>Go to the first section and scroll up or to the last one and scroll down to see how it works.</p>
</div>
</div>
<div class="section" id="section2">
<div class="intro">
<h1>Scroll Down</h1>
<p>And it will animate down to the first section</p>
</div>
</div>


</body>
</html>
75 changes: 75 additions & 0 deletions examples/css3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS3 - fullPage.js</title>
<meta name="author" content="Alvaro Trigo Lopez" />
<meta name="description" content="fullPage.js using CSS3 transformations." />
<meta name="keywords" content="fullpage,jquery,anchor,links,inside,demo,css,css3" />
<meta name="Resource-type" content="Document" />


<link rel="stylesheet" type="text/css" href="../jquery.fullPage.css" />
<link rel="stylesheet" type="text/css" href="demoPage.css" />

<!--[if IE]>
<script type="text/javascript">
var console = { log: function() {} };
</script>
<![endif]-->

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>

<script type="text/javascript" src="../jquery.fullPage.js"></script>
<script type="text/javascript" src="examples.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var pepe = $.fn.fullpage({
slidesColor: ['#1bbc9b', '#4BBFC3', '#7BAABE'],
css3: true,
fixedElements: "#demosMenu"
});
});
</script>

</head>
<body>


<select id="demosMenu">
<option id="background" selected>Choose Demo</option>
<option id="background">Background Images</option>
<option id="looping">Looping</option>
<option id="noAnchor">No anchor links</option>
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>


<div class="section " id="section0">
<h1>fullPage.js</h1>
<p>CSS3</p>
<img src="imgs/fullPage.png" alt="fullPage" />
</div>
<div class="section" id="section1">
<div class="intro">
<h1>Speed on mobile</h1>
<p>
If CSS3 transforms are supported (e.g. on mobile devices) they will be used for animations, usually a good
choice if the animation on mobile devices is slow.
</p>
</div>
</div>
<div class="section" id="section2">
<div class="intro">
<h1>No CSS3? No problem!</h1>
<p>If CSS3 is not available, animations will fall back to jQuery animate.</p>
</div>
</div>
</body>
</html>
2 changes: 2 additions & 0 deletions examples/demoPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>


Expand Down
2 changes: 2 additions & 0 deletions examples/easing.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>


Expand Down
10 changes: 9 additions & 1 deletion examples/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ $(document).ready(function(){

case 'callbacks':
window.location.href = 'callback.html';
break;
break;

case 'css3':
window.location.href = 'css3.html';
break;

case 'continuous':
window.location.href = 'continuous.html';
break;
}
});

Expand Down
2 changes: 2 additions & 0 deletions examples/looping.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>


Expand Down
2 changes: 2 additions & 0 deletions examples/noAnchor.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>


Expand Down
2 changes: 2 additions & 0 deletions examples/scrollingSpeed.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<option id="scrollingSpeed">Scrolling speed</option>
<option id="easing">Easing</option>
<option id="callbacks">Callbacks</option>
<option id="css3">CSS3</option>
<option id="continuous">Continuous scrolling</option>
</select>


Expand Down
Loading

0 comments on commit 02746ef

Please sign in to comment.