react-scroll
Advanced tools
Comparing version 1.0.4 to 1.0.5
"use strict"; | ||
var React = require('react'); | ||
var assign = require('react/lib/Object.assign'); | ||
var Helpers = require('../mixins/Helpers'); | ||
@@ -6,0 +5,0 @@ |
"use strict"; | ||
var React = require('react'); | ||
var assign = require('react/lib/Object.assign'); | ||
var Helpers = require('../mixins/Helpers'); | ||
@@ -6,0 +5,0 @@ |
@@ -29,3 +29,3 @@ var smooth = require('./smooth'); | ||
*/ | ||
var requestAnimationFrame = (function () { | ||
var requestAnimationFrameHelper = (function () { | ||
return currentWindowProperties() || | ||
@@ -77,3 +77,3 @@ function (callback, element, delay) { | ||
if(__percent < 1) { | ||
requestAnimationFrame.call(window, animateTopScroll); | ||
requestAnimationFrameHelper.call(window, animateTopScroll); | ||
return; | ||
@@ -97,3 +97,3 @@ } | ||
requestAnimationFrame.call(window, animateTopScroll); | ||
requestAnimationFrameHelper.call(window, animateTopScroll); | ||
}; | ||
@@ -100,0 +100,0 @@ |
{ | ||
"name": "react-scroll", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A scroll component for React.js", | ||
@@ -5,0 +5,0 @@ "main": "lib", |
## React Scroll | ||
Directive for basic scrolling and smooth scrolling. | ||
Mixins has been removed and replaced with high ordered components (2016-02-02) | ||
@@ -34,2 +33,3 @@ ### Install | ||
var Events = Scroll.Events; | ||
var scroll = Scroll.animateScroll; | ||
@@ -52,16 +52,21 @@ var Section = React.createClass({ | ||
}, | ||
scrollToTop: function() { | ||
scroll.scrollToTop(); | ||
}, | ||
render: function () { | ||
return ( | ||
<div> | ||
<Link activeClass="active" to="test1" spy={true} smooth={true} offset={50} duration={500} >Test 1</Link> | ||
<Button activeClass="active" className="btn" type="submit" value="Test 2" to="test2" spy={true} smooth={true} offset={50} duration={500} >Test 2</Button> | ||
<div> | ||
<Link activeClass="active" to="test1" spy={true} smooth={true} offset={50} duration={500} >Test 1</Link> | ||
<Button activeClass="active" className="btn" type="submit" value="Test 2" to="test2" spy={true} smooth={true} offset={50} duration={500} >Test 2</Button> | ||
<Element name="test1" className="element"> | ||
test 1 | ||
</Element> | ||
<Element name="test1" className="element"> | ||
test 1 | ||
</Element> | ||
<Element name="test2" className="element"> | ||
test 2 | ||
</Element> | ||
</div> | ||
<Element name="test2" className="element"> | ||
test 2 | ||
</Element> | ||
<a onClick={this.scrollToTop}>To the top!</a> | ||
</div> | ||
); | ||
@@ -68,0 +73,0 @@ } |
22798
156
557