Repository: Prinzhorn/skrollr Branch: master Commit: e52648d1b75a Files: 42 Total size: 418.7 KB Directory structure: gitextract_3ld3pulh/ ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Gruntfile.js ├── HISTORY.md ├── LICENSE.txt ├── README.md ├── bower.json ├── examples/ │ ├── README.md │ ├── amd.html │ ├── anchor_target.html │ ├── anchors.html │ ├── bg_constant_speed_less.html │ ├── bg_constant_speed_more.html │ ├── circular_motion.html │ ├── classic.html │ ├── docu/ │ │ ├── 1.html │ │ ├── 2.html │ │ ├── 3.html │ │ └── 4.html │ ├── fixed-positioning.css │ ├── fixed_nav.html │ ├── gradientsmotherfucker.html │ ├── main.css │ ├── path.html │ ├── pausing.html │ ├── scripts/ │ │ ├── main.js │ │ └── require.js │ └── svg.html ├── index.html ├── package.json ├── shim.html ├── src/ │ └── skrollr.js └── test/ ├── index.html ├── jquery.js ├── loading-tests.js ├── loading.html ├── qunit-numeric-css-property-equals.js ├── qunit.css ├── qunit.js ├── require.js └── tests.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ node_modules/ ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - 0.10 ================================================ FILE: CONTRIBUTING.md ================================================ Questions belong to StackOverflow ===== GitHub is for issues and feature requests. Anything else belongs to [StackOverflow](http://stackoverflow.com/questions/ask?tags=skrollr). Pull requests ===== Will be ignored if the Travis build fails. Install grunt and run `grunt jshint qunit` locally before submitting pull requests. Do not include build files in your pull request (e.g. `skrollr.min.js`). Do not change the version number in your pull request. Do not try to fix multiple issues or add multiple features with a single pull request. A pull request should only do one thing. ================================================ FILE: Gruntfile.js ================================================ module.exports = function(grunt) { //Configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json') , jshint: { options: { smarttabs: false, curly: true, immed: true, latedef: true, noarg: true, quotmark: 'single', undef: true, unused: true, strict: true, trailing: true, globals: { window: true, document: true, navigator: true, define: true, module: true } }, all: ['src/**/*.js'] }, qunit: { all: ['test/index.html', 'test/loading.html'] }, uglify: { options: { banner: '/*! skrollr <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>) | Alexander Prinzhorn - https://github.com/Prinzhorn/skrollr | Free to use under terms of MIT license */\n' }, all: { files: { 'dist/skrollr.min.js': 'src/skrollr.js' } } } }); //Dependencies. grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-uglify'); //Tasks. grunt.registerTask('default', ['jshint', 'qunit', 'uglify']); grunt.registerTask('travis', ['jshint', 'qunit']); }; ================================================ FILE: HISTORY.md ================================================ 0.6.30 (2015-06-19) ------------------- * Respect result of beforerender callback on mobile (#717) * Allow for a duration of 0 when scrolling (#720) 0.6.29 (2014-11-17) ------------------- * Make the ID of `skrollr-body` configurable (#592) 0.6.28 (2014-11-15) ------------------- * In cases where skrollr-body has a height other than `auto` the height of its content is now correctly calculated. This should solve many issues on mobile where scrolling got stock before reaching the bottom (#633) 0.6.27 (2014-09-28) ------------------- * Fixed AMD module definition (#609) 0.6.26 (2014-06-08) ------------------- * Fixed easing functions not working when animating attributes (#533) 0.6.25 (2014-05-22) ------------------- * CommonJS (#519). 0.6.24 (2014-04-25) ------------------- * Fixed some issue with forceHeight (#347). * Fixed a regression caused by #486 breaking IE 8 (#494). * Added support for animating attributes (#204). 0.6.23 (2014-04-18) ------------------- **note**: This particular version is broken in IE! * Experimental support for emitting events when the scrolling passes a keyframe (check out the docs for `keyframe` option/event). * When using `refresh`, make sure elements which do not longer have keyframes get properly cleaned up (#486). * Fixed `refresh` not accepting `NodeList`s (#435). * Expose the status of mobile mode as `isMobile()` function (#488). 0.6.22 (2014-02-21) ------------------- * Experimental AMD support (#409). Please read the documentation about it. 0.6.21 (2014-01-06) ------------------- * Disabled mobile mode on Windows Phone, since it's not needed there (#408). 0.6.20 (2014-01-03) ------------------- * Fixed broken percentage constants. 0.6.19 (2014-01-02) ------------------- * Constants can now be defined as functions or percentage offsets (#148, #404). **breaking**: When using a constant of value `100` together with percentage offsets like `data-_foo-75p`, the value was implicitly handled as percentage value `100p`. Starting with this version you need to explcitly use `100p` if you want percentage constants. On the plus side, you can now mix an absolute constant with a percentage keyframe or a percentage constant with an absolute keyframe. 0.6.18 (2013-12-18) ------------------- * Fixed scrolling on input elements (#397). 0.6.17 (2013-10-19) ------ * Fixed keyboard not appearing on some mobile browsers when an input was focused (#349). 0.6.16 (2013-10-18) ------ * Fixed `z-index:auto;` not working because it was always coerced to an integer (#351). 0.6.15 (2013-10-03) ------ * Fixed clicking on links (and other elements) on mobile (#263, #303, #338). * Added `getMaxScrollTop` method (#238). 0.6.14 (2013-10-03) ------ * Fixed the `direction` parameter that's passed to the render events (#339). 0.6.13 (2013-09-29) ----- * Added support for percentage offsets (#185). 0.6.12 (2013-09-17) ----- * Added `destroy` method (#109). 0.6.11 (2013-08-13) ----- * Made the mobile deceleration configurable and lowered the default (#222, #229). 0.6.10 (2013-07-30) ----- * Fixed bug which caused IE to perform an endless loop (#271). 0.6.9 (2013-07-01) ----- * Improved overall performance for mobile (#249). 0.6.8 (2013-06-17) ----- * Added a new option `smoothScrollingDuration`. 0.6.7 (2013-06-17) ----- * Changed the default value of `edgeStrategy` from `ease` to `set`. There are too many cases where `ease` was not wanted and unexpected. 0.6.6 (2013-06-05) ----- * Fixed IE plugin not working. This was caused by assigning `skrollr.setStyle` to a local variable inside the skrollr core. Since the IE plugin monkey-patches the skrollr.setStyle function, the core didn't notice the change (#199 comment 18986949). 0.6.5 (2013-05-22) ----- * Fixed crash in IE < 9 because the detected prefix was `null` (#220). 0.6.4 (2013-05-21) ----- * Fixed that some elements got the `skrollable-before` **and** `skrollable-after` class at the same time. 0.6.3 (2013-05-19) ----- * When resizing the browser, the scroll position was reset to 0 (#217) 0.6.2 (2013-05-18) ----- * When resizing the browser, `forceHeight` was colliding with the already forced height (#216). 0.6.1 (2013-05-18) ----- * Allow numbers inside of easing function names (#152). 0.6.0 (2013-05-18) ----- **Expect things to break when coming from 0.5! Read through the changelog. Migration is not hard.** * **[breaking]** There's no more `skrollr.mobile.js` file. You only need `skrollr.js`. You no longer need to conditionally include `skrollr.mobile.js`. * You can configure how skrollr detects mobile browsers using the `mobileCheck` option (check out the documentation). * **[possibly breaking]** The meaning of the `#skrollr-body` element changed. Put all static elements inside of it and all absolute/fixed elements outside. It doesn't need to be the first child of the body anymore. * **[breaking]** The `rendered` and `unrendered` classes where renamed because they were confusing and wrong. They're now called `skrollable-before` and `skrollable-after`, because that's their meaning (the element with these classes is before/after the first/last keyframe). * Added a new class `skrollable-between`, because symmetry. That's why. * Easing functions are now applied when exactly at a keyframe (#132). * **[possibly breaking]** The behavior changed for the case when the scroll position is before/after the first/last keyframe (I'm just gonna use "before first" from now on, because "after last" is analog). In 0.5 the behavior was not exactly specified and buggy (see item above regarding #132). Skrollr was applying the styles of the first keyframe to the element for all scroll position that were before the first keyframe. E.g. when `data-100="top:200px;"` was the first keyframe, the element had `top:200px;` at all scroll positions before (all from `0` to `99`). From now on you can specify the behavior you want (see `edgeStrategy` option for details, set it to `set` for old behavior). **Note: 0.6.7 and up use `set` as default.** 0.5.14 ----- * Add a `skrollr-mobile` class to the html element when the mobile script is included. 0.5.13 (2013-02-08) ----- * #131: Use a cross browser approach for getting the body scroll-height. * #133: Use the maximum of document height or the max keyframe for edge cases where absolute keyframes are used in a relative-mode-like document and `data-end` was calculated wrong. 0.5.12 (2013-02-08) ----- * #121: Fixed prefix detection in Safari. 0.5.11 (2013-01-18) ----- * #126: When calling refresh(), force rerendering, even if the scrollbar didn't move. 0.5.10 ----- * #104: Fixed the most annoying bug on mobile. There was a large blank space at the bottom of the page. 0.5.9 ----- * #118: Fixed broken prefix detection. Was broken all the time, but worked before Firefox 18. 0.5.8 (2013-01-12) ----- * #116 + #117: SVG support was broken for relative mode. 0.5.7 ----- * #103: skrollr no longer depends on being added to the bottom of the document. 0.5.6 ----- * #105: Fixed inconsistent behaviour for adding `rendered` and `unrendered` class on page load 0.5.5 ----- * #100: Fixed relative-mode not working correctly in IE < 9 due to crippled getBoundingClientRect 0.5.4 (2012-11-18) ----- * #80: When resizing the browser window the calculation of relative mode was wrong when the element's vertical position was changed before. 0.5.3 ----- * #66: Make IE 7 support a light version of `data-anchor-target` by mapping `querySelector` to `getElementById`. 0.5.2 ----- * #78: Fixed that new parser didn't allowed omitting the last semicolon in a keyframe property list. 0.5.1 (2012-10-29) ----- * Fixed `setScrollTop` and `animateTo` not working because iScroll uses negative offset. 0.5.0 (2012-10-09) ----- * *breaking* the `plugin` api has been removed (the IE plugin has been updated to a new, hidden api). * Full mobile support using iscroll. * #73: Fixed parser to not mess up colons inside URLs * #74: Fixed parser to not treat single periods as decimal numbers * #76: Fixed dummy element overlaping the content, even though it should be unobtrusive 0.4.13 ----- * #58: `forceHeight` now handles relative mode like a boss. * #59: Make `scale` option only affect absolute mode. 0.4.12 ----- * #64: Setting `float` property using JavaScript didn't work across browser. Now using `styleFloat` and `cssFloat` properties. 0.4.11 (2012-09-17) ----- * The `scale` option does not affect `constants`. 0.4.10 ----- * Allow smooth scrolling on element level using `data-smooth-scrolling` 0.4.9 ----- * Added experimental smooth scrolling (no more CSS transitions. WORKS IN IE.). 0.4.8 ----- * Added `stopAnimateTo` method. 0.4.7 ----- * Updated the requestAnimationFrame polyfill for smoother animations * Updated the way requestAnimationFrame is used for even smoother animations 0.4.6 ----- * New method `relativeToAbsolute` which was formerly private * New method `isAnimatingTo` to check if an animation caused by `animateTo` is running * Added `sqrt` easing function 0.4.5 ----- * Experimental mobile support using https://github.com/zynga/scroller 0.4.4 ----- * A `skrollr` class is added to the HTML element and a `no-skrollr` class is removed when `init` is called. Useful for fallback styling. 0.4.3 (2012-08-02) ----- * Added new feature "constants". 0.4.2 (2012-07-26) ----- * Added new feature "anchor-target" which allows elements to react to other elements leaving/entering the viewport. 0.4.1 (2012-07-25) ----- * Fixed a bug which broke skrollr in IE caused by wrong regular expression behavior 0.4.0 (2012-07-22) ----- * *breaking* the `data-end-[offset]` syntax changed. It's now `data-[offset]-end`. * Fixed a bug where white spaces between style declarations were not ignored. * Added support for anchors. Animations can now be specified relative to the elements position within the viewport. * Added support for SVG elements. * Added new method `refresh()`. ================================================ FILE: LICENSE.txt ================================================ The MIT License Copyright (c) 2012-2014 Alexander Prinzhorn (@Prinzhorn) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ [![Build Status](https://secure.travis-ci.org/Prinzhorn/skrollr.png)](http://travis-ci.org/Prinzhorn/skrollr) Please note: ============ **skrollr hasn't been under active development since about September 2014** (check out the contributions graphs on https://github.com/Prinzhorn/skrollr/graphs/contributors) and I don't have any plans for doing major changes to it. Please consider this before using skrollr in production as problems with new browser versions, especially on mobile, will most definitely surface. To be honest, mobile support always sucked (because mobile browsers are hard) and you shouldn't compromise UX for some fancy UI effects. Ever. skrollr 0.6.30 ============== Stand-alone **parallax scrolling** JavaScript library for **mobile (Android, iOS, etc.) and desktop** in about 12k minified. Designer friendly. No JavaScript skills needed. Just plain CSS and HTML. _Actually, skrollr is much more than "just" **parallax scrolling**. It's a full-fledged scrolling animation library. In fact, you can use it and still have no parallax scrolling at all. But I wanted to sound hip and use some buzz-words. By the way, skrollr leverages HTML5 and CSS3 ;-)_ Resources ===== Plugins ----- ### Official * [skrollr-menu](https://github.com/Prinzhorn/skrollr-menu) - Hash navigation * [skrollr-ie](https://github.com/Prinzhorn/skrollr-ie) - IE < 9 CSS fixes * [skrollr-stylesheets](https://github.com/Prinzhorn/skrollr-stylesheets) - Keyframes inside CSS files ### Third party * [skrollr-colors](https://github.com/FezVrasta/skrollr-colors) - Mix and match hex, rgb and hsl colors. * [skrollr-decks](https://github.com/TrySound/skrollr-decks) - Fullpage presentation decks. In the wild ----- Check out the [wiki page](https://github.com/Prinzhorn/skrollr/wiki/In-the-wild) for websites using skrollr and feel free to add your own website :). You can also shamelessly add yourself to the list [here](https://github.com/Prinzhorn/skrollr/wiki/Agencies-and-freelancers) if you are offering paid skrollr support. Further resources (tutorials etc.) ----- Moved to the [wiki](https://github.com/Prinzhorn/skrollr/wiki/Resources). Documentation ===== First of all: look at the [examples and read the source ;-)](https://github.com/Prinzhorn/skrollr/tree/master/examples). This might give you a feeling of how stuff works and you can see how some patterns can be implemented. Abstract ------ skrollr allows you to animate any CSS property of any element depending on the horizontal scrollbar position. All you need to do is define key frames for each element at certain points in top scroll offset. Other libraries require you to write JavaScript in order to define your animations. This introduces two main problems: * Animation and element are not at one place. In order to find out if any animations are defined for a given element, you have to scroll through many (sometimes thousands) of lines of JavaScript. * You have to learn a new syntax which is often very verbose and limited at the same time. With skrollr, you put the definition of your key frames right where they belong (to the element) using a syntax you already know (plain CSS). If you would rather have the keyframes inside a separate file, take a look at [skrollr-stylesheets](https://github.com/Prinzhorn/skrollr-stylesheets). If you prefer to use JavaScript to define your animations make sure to take a look at [ScrollMagic](https://github.com/janpaepke/ScrollMagic). It depends on both jQuery and the Greensock Animation Platform (GSAP) and gives you full control over every detail of your animations. Let's get serious ------ First of all you want to include the `skrollr.min.js` file at the bottom of your document (right before the closing ``) and then call `skrollr.init()`. Or you can place it inside the `` if you want to, but make sure to call `init()` once the document has been loaded (e.g. jQuery's `ready` event or even `window.onload`). ```html ``` If you are using require.js to structure your project, you can use skrollr as a module as well. ```javascript require(['skrollr'], function(skrollr){ var s = skrollr.init(); }); ``` If you're familiar with CSS, you already know the `style` attribute. In order to create an animation you would need several, at least two, of them. That's what skrollr does. You use the HTML5 `data-` attributes to define multiple sets of styles (we call each of them **keyframe**) and skrollr interpolates between them. #### Let's change the background-color of a `div` starting at `#00f` when the scrollbar is at the top and ending with `#f00` when the user scrolled 500 pixels down ```html
WOOOT
``` [View in browser](http://prinzhorn.github.io/skrollr/examples/docu/1.html) ##### Lessons learned * Skrollr ensures that you can actually scroll down 500 pixels or more, even if there's not enough content. You can suppress this by using the `forceHeight` option. * You can't use `#00f` or `#0000ff`. You need to use `rgb` or `hsl` and explicitly decide which color space you want because they result in different animations (HSL is much cooler most of the time). Don't worry, the IE plugin teaches IE < 9 to display `rgb` and `hsl` correctly. #### Now let's do a barrel roll at the same time ```html
WOOOT
``` [View in browser](http://prinzhorn.github.io/skrollr/examples/docu/2.html) ##### Lessons learned * Skrollr handles all these nasty CSS prefixes for you. Just -moz-relax and get yourself a cup of -webkit-coffee. #### Now let the rotation bounce like it were a hip-hop video ```html
WOOOT
``` [View in browser](http://prinzhorn.github.io/skrollr/examples/docu/3.html) #### Lessons learned * Skrollr allows non-linear animations. The so called *easing functions* can be used per-property by putting them in square brackets behind the property. There's a built-in list of easing functions (see below in the [JavaScript](#javascript) section) and you can use your own functions by using the `easings` options. Now you may have noticed that using `500` as a keyframe position is kind of random and the look depends on your browser size. #### Let's have the animation end when the top of the element reaches the top of the viewport (element leaves the viewport) ```html
WOOOT
``` [View in browser](http://prinzhorn.github.io/skrollr/examples/docu/4.html) ##### Lessons learned * Skrollr keyframes can either be [absolute](#absolute-mode-or-document-mode) or [relative](#relative-mode-or-viewport-mode). That's the end of this short intro. The following sections will explain some more things in detail. If you're not a fan of `data-attributes` or if you're planning a big website where you want a better and more flexible structure, take a look at [skrollr-stylesheets](https://github.com/Prinzhorn/skrollr-stylesheets). Mobile support ----- Starting with version 0.5.0 skrollr officially supports mobile browsers including Android and iOS. Furthermore, mobile support has been rewritten from scratch for skrollr 0.6.0. ### The Problem with mobile and the solution (If you're not interested in the details, just scroll down a bit to see what you need to do for mobile support.) Some words on why this is an important milestone and why others failed: Mobile browsers try to save battery wherever they can. That's why mobile browsers delay the execution of JavaScript while you are scrolling. iOS in particular does this very aggressively and completely stops JavaScript. In short, that's the reason why many scrolling libraries either don't work on mobile devices or they come with their own scrollbar which is a usability nightmare on desktop. It was an important requirement while I developed skrollr that I don't force you to scroll the way I want it. skrollr on desktop uses a native scrollbar and you can scroll the way you want to (keyboard, mouse, etc.). You just told me it doesn't work on mobile, but why does it? The answer is simple. When using skrollr on mobile you don't actually scroll. When detecting a mobile browser, skrollr disables native scrolling and instead listens for touch events and moves the content (more specific the `#skrollr-body` element) using CSS transforms. ### What you need in order to support mobile browsers Starting with skrollr 0.6.0 there's just one thing you need to do: Include an element on your page with the id `skrollr-body`. That's the element we move in order to fake scrolling. The only case where you don't need a `#skrollr-body` is when using `position:fixed` exclusively. In fact, the skrollr website doesn't include a `#skrollr-body` element. If you need both fixed and non-fixed (i.e. static) elements, put the static ones inside the `#skrollr-body` element. Or to put it differently: On mobile the `skrollr-body` element is moved using CSS transforms. You can't have `position:fixed` or `background-attachment:fixed` inside elements which use CSS transforms as per CSS spec (http://meyerweb.com/eric/thoughts/2011/09/12/un-fixing-fixed-elements-with-css-transforms/). That's why those elements need to be **outside** of the `skrollr-body` element. The `skrollr-body` element might be configured within the [init-options](#skrollrinitoptions). AMD --- Starting with `0.6.22` there's experimental AMD support. Please note that only skrollr core has AMD support so far. We will update the plugins in the future. ```js require(['skrollr'], function(skrollr){ skrollr.init(); }); ``` Absolute vs relative mode ----- Being only able to define key frames in absolute values is simply insufficient for some cases. For example, if you don't know exactly where an element will be in the document. That's why there are two modes for key frames, namely `absolute` and `relative` mode. ### absolute mode (or document mode) The key frames are defined as absolute values describing how much the **document** has been scrolled down. The syntax is `data-[offset]-[anchor]`, where `offset` can be any integer (0 is default) and `anchor` can be either `start` (default) or `end`. Either `offset` or `anchor` can be omitted in some situations. Here are some examples of key frames and their meaning. * `data-0` = `data-start` = `data-0-start`: When the scroll top is 0. * `data-100` = `data-100-start`: When the scroll top is 100. * `data--100` = `data--100-start`: When the scroll top is -100 (sounds like nonsense, but keep in mind that interpolation will be relative to this point). * `data-end` = `data-0-end`: When offset is 0, but counting from the bottom of the document instead of from the top. In short: when you reach the bottom of the page. * `data-100-end`: 100px before we reach the bottom. * `data--100-end`: 100px after we reach the bottom (again, it's up to you whether you need it). ### relative mode (or viewport mode) Instead of defining key frames relative to the **document** (i.e. absolute), we are able to define them depending on the position of any element in relation to the **viewport**. The syntax is `data-[offset]-(viewport-anchor)-[element-anchor]`, where `offset` can again be any integer and defaults to 0. Both `viewport-anchor` (mandatory) and `element-anchor` (optional) can be one of `top`, `center` or `bottom`. If `element-anchor` is omitted, the value of `viewport-anchor` will be taken (just like with background-position). Here are some examples of key frames and their meaning. * `data-top` = `data-0-top` = `data-top-top` = `data-0-top-top`: When the element's top is aligned with the top of the viewport. * `data-100-top` = `data-100-top-top`: When the element's top is 100px above the top of the viewport. * `data--100-top` = `data--100-top-top`: When the element's top is 100px below the top of the viewport. * `data-top-bottom `= `data-0-top-bottom`: When the bottom of the element is at the top of the viewport (it's just not visible). * `data-center-center` = `data-0-center-center`: When the element is at the center of the viewport. * `data-bottom-center` = `data-0-bottom-center`: When the element's center is at the bottom of the viewport, thus the upper half of the element is visible. By default the keyframes are triggered by the position of the element where the keyframes are described. However there are times when the position of a second element should trigger the first element's keyframes. The `data-anchor-target` attribute can be used in these cases. The `data-anchor-target` attribute accepts any CSS selector and the position of the first element on the page matching the selector will be used to trigger keyframes on the element where the attribute is defined. `data-anchor-target` requires IE 8 or greater. Examples: `
` will have it's keyframes tiggered by the position of the `#foo element`. Any CSS selector can be used, i.e `data-anchor-target=".bar:not(.bacon) ~ span > a[href]"` **Note**: If you need to support IE 7, then you may only use IDs as `anchor-target`s, i.e. `#foo`. The IE plugin maps `querySelector` to `getElementById`. Here's an infographic for better understanding of anchors (click to open PDF): [![Anchors Guide](https://raw.github.com/Prinzhorn/skrollr/master/guide/anchor-position-guide.png)](https://raw.github.com/Prinzhorn/skrollr/master/guide/anchor-position-guide.pdf) **Important**: All those values will be calculated up-front and transformed to `absolute` mode. So if either the element's box height changes (height, padding, border) or the elements position within the document, you probably need to call `refresh()` (see documentation in JavaScript section below). **Window resizing is handled by skrollr.** Percentage offsets ------------------ All offsets shown above are given in absolute pixel values, e.g. `data-300` for `300px` from the top or `data-13-top-bottom` for a `13px` offset to the `top-bottom` anchor. As of skrollr `0.6.13` you can also have offsets as percentages of the viewport by appending a `p` to the number. For example `data-75p` for when you scrolled down `75%` of the viewport or `data-10p-center` to have a `10%` offset from the `center` anchor. Hash navigation ----- Check out the [skrollr-menu](https://github.com/Prinzhorn/skrollr-menu) plugin. Working with constants ----- I was lying to you. The syntax for absolute mode is not `data-[offset]-[anchor]` and for relative mode it's not `data-[offset]-(viewport-anchor)-[element-anchor]`. In both cases, `offset` can be preceded by a constant which can be passed to the `init` method. The name of the constant needs to be preceded with an underscore. Example: ```js skrollr.init({ constants: { foobar: 1337 } }); ``` ```html
``` Valid characters for a constant are `[a-z0-9_]`. Dynamic constants ----------------- Starting with skrollr `0.6.19` the word "constants" doesn't quite fit anymore, but who cares. You can now use functions and percentages as constants. They are automatically evaluated when the window is resized or if you call `refresh`. ```js skrollr.init({ constants: { foo: function() { //Note: you can access the skrollr instance with `this` for things like `this.relativeToAbsolute` return Math.random() * 100;//trolololol }, vh: '100p' } }); ``` CSS classes ----- skrollr will add a `skrollr` class to the `HTML` element when calling `init` and will remove a `no-skrollr` class if present. Additionally, it will add a `skrollr-desktop` or `skrollr-mobile` class depending on which it detects. This allows fallback CSS rules to create a good user experience on unsupported devices or when JavaScript or skrollr are disabled. All elements under skrollr's control (elements with appropriate data-attributes) will get the `skrollable` class. In addition, we add either the `skrollable-before`, `skrollable-between` **or** `skrollable-after` class, depending on whether the current scroll position is before, between or after the first/last (smallest/largest) keyframe of an element. Animating attributes -------------------- Starting with skrollr 0.6.24 you can also animate attribute and not just style properties. This is especially a big thing because in the SVG world many properties are implemented as attributes and not in CSS. Animating an attribute couldn't be simplier, just prefix the property with an `@` symbol! ```html ``` Note: as always, skrollr doesn't do any magic. It doesn't understand what a polygon or points are. It's only interpolating numbers, that's it. So make sure you have the same number of numbers in your keyframes (8 in this case). Filling missing values ----- Imagine the following animation ```html
``` One could expect `left` to have a value of `25%` at keyframe `200`. That is **not** the case. By design, skrollr only interpolates values between key frames which are direct **neighbors**. What actually happens is that skrollr internally fills out all holes once from left and then from right. So the above is equivalent to ```html
``` Preventing interpolation ----- The reason why skrollr is so lightweight and powerful is because it literally interpolates **every** number it can find. If you want to prevent some side effect, you can suppress interpolation for a specific value by prepending an exclamation point. Example: ```html
``` **Note:** The values for both keyframes (if they contain a number) need to be prefixed if you want to avoid skrollr throwing an exception at you! Limitations ----- There are some limitations of skrollr you should be aware of. * All numeric values have to have the same unit, even `0` needs a unit. It's not possible to animate from `5%` to `100px`. skrollr won't complain, but results are undefined. * Animations between values which are composed of multiple numeric values like `margin:0 0 0 0;` are only possible for the same number of values. `margin:0px 0px 0px 0px;` to `margin:0px 100px 50px 3px;` is fine, but not `margin:10px;` to `margin:5px 10px;`. * Animations between CSS transforms only work when they use the same functions in same order. From `rotate(0deg) scale(1)` to `rotate(1000deg) scale(5)` is fine. * Color animations don't support named values like "red" or hex values like "#ff0000". Instead, you have to use `rgb()`, `rgba()`, `hsl()` and `hsla()`. Don't worry, there's a skrollr plugin for IE < 9 to support `hsl()` (without "a"!) and to fall rgba back to rgb. * Color animations only work for same color functions. `hsl()` to `hsl()` or `hsla()` is fine, but not `rgb()` to `hsl()`. Which makes sense, because animating from the same colors in rgb space and in hsl space results in different animations (hsl gives you the nice rainbow stuff). But feel free to send in a pull request to fix any of them. Just keep in mind that keeping skrollr as lightweight as possible has high priority. JavaScript ==== On the JavaScript part there's not much to do (you can, if you want to!). So if you only know CSS and HTML, perfect. skrollr.init([options]) ----- All there is to do is to call `skrollr.init([options]);` which returns an instance of the singleton skrollr class. Subsequent calls to `init()` will just return the same skrollr instance again. Possible options for `init()` are ### smoothScrolling=true Smooth scrolling smoothens your animations. When you scroll down 50 pixels, the animations will transition instead of jumping to the new position. The global setting can be overridden per element by setting `data-smooth-scrolling` to `on` or `off`. ### smoothScrollingDuration=200 The number of milliseconds the animations run after the scroll position changed the last time. ### constants={} An object containing integers as values. The keys can contain `[a-z0-9_]`. They *do not* need a leading underscore. Example: `data-_myconst-200` and `skrollr.init({constants: {myconst: 300}})` result in `data-500`. ### scale=1 By default, skrollr uses the largest key frame and makes document height + viewport height this high, thus the max possible scroll top offset. If your animation runs too fast or too slow, just adjust the scale value. `scale` only affects keyframes in absolute mode. When `forceHeight` is set to false, `scale` is ignored. `scale` affects `constants` as well. `scale` does only affect key frames in absolute mode, e.g. `data-500` but not `data-top`. ###forceHeight=true `true`: Make sure the document is high enough that all key frames fit inside. Example: You use `data-1000`, but the content only makes the document 500px high. skrollr will ensure that you can scroll down the whole 1000px. Or if you use relative mode, e.g. `data-top-bottom`, skrollr will make sure the bottom of the element can actually reach the top of the viewport. `false`: Don't manipulate the document and just keep the natural scrollbar. ###mobileCheck=function() {...} This option allows you to pass a function to skrollr overwriting the check for mobile devices. The function should return `true` when mobile scrolling should be used and `false` if not. The default looks like this ```js function() { return (/Android|iPhone|iPad|iPod|BlackBerry/i).test(navigator.userAgent || navigator.vendor || window.opera); } ``` ### mobileDeceleration=0.004 The amount of deceleration for momentum scrolling on mobile devices. This options tells skrollr how fast or slow you want the scrolling to stop after the user lifted his finger. Set it to `1` to disable momentum scrolling. ### skrollrBody='skrollr-body' This option allows you to override the default id-selector used for supporting mobile browsers. It might come in handy when the element in question already has a assigned id or if you would like to define more then one skrollrBody depending on preceding JavaScript-logic. ### edgeStrategy='set' This option specifies how to handle animations when the scroll position is outside the range on the keyframes (i.e. before the first or after the last keyframe). One of three options are possible * `set` _(default)_: When before/after the first/last keyframe, apply the styles of the first/last keyframe to the element. * `ease`: Same as set, but the values will be transformed using the given easing function. * `reset`: When before/after the first/last keyframe, apply the styles which the element had before skrollr did anything. This means resetting the class attribute as well as removing all styles which have been applied to the `style` property. This means the element won't have any `skrollable-*` CSS classes. Example: Given the following element with two keyframes ```html
``` and the following easing function which always returns `0.5` (I know it's pointless, but it's just an example. A real world example would be an easing function that represents a curve and starts somewhere between `0` and `1`, but not at `1`) ```js function(p) { return 0.5; } ``` and imagine the scrollbar is at `237`, which is below the first keyframe which is at `1000`. * `set` will result in `
` which is plain `data-1000`. * `ease` will result in `
` which is `0.5 * data-1000`. * `reset` will result in `
` which is what the element originally had. Note how `top` is missing. ### beforerender A listener function that gets called each time right before we render everything. The function will be passed an object with the following properties: ```js { curTop: 10, //the current scroll top offset lastTop: 0, //the top value of last time maxTop: 100, //the max value you can scroll to. curTop/maxTop will give you the current progress. direction: 'down' //either up or down } ``` Returning `false` will prevent rendering. ### render A listener function that gets called right after we finished rendering everything. The function will be passed with the same parameters as `beforerender`. Example ```js skrollr.init({ render: function(data) { //Log the current scroll position. console.log(data.curTop); } }); ``` ### keyframe **Experimental** In order to receive `keyframe` events from an element, add the `data-emit-events` attribute to the element. The keyframe function will be called with three arguments 1. The `element` that passed the keyframe. 2. The `name` of the keyframe, camel-cased (see example). 3. The `direction` the user is scrolling. Example: ```html
Some content
``` ```js skrollr.init({ keyframe: function(element, name, direction) { //name will be one of data500, dataTopBottom, data_offsetCenter } }); ``` Note: this is experimental, expect the API to change! Originally I wanted to emit the events right on the element, so you could do this ```js //Wouldn't this be nice? document.querySelector('#foo').addEventListener('skrollr.dataTopBottom.up', function() { //#foo just passed the data-top-bottom keyframe while scrolling up }, false) ``` but IE. ### easing An object defining new easing functions or overwriting existing ones. Easing functions get just one argument, which is a value between 0 and 1 (the percentage of how much of the animation is done). The function should return a value between 0 and 1 as well, but for some easings a value less than 0 or greater than 1 is just fine. An easing function basically transforms the timeline for an animation. When the animation should be 50% done, you can transform it to be 90% done or whatever your function does. Example: ```js skrollr.init({ easing: { //This easing will sure drive you crazy wtf: Math.random, inverted: function(p) { return 1 - p; } } }); ``` You can now use the easing functions like any other. skrollr ships with some built in functions: * linear: The default. Doesn't need to be specified. * quadratic: To the power of two. So 50% looks like 25%. * cubic: To the power of three. So 50% looks like 12.5% * begin/end: They always return 0 or 1 respectively. No animation. * swing: Slow at the beginning and accelerates at the end. So 25% -> 14.6%, 50% -> 50%, 75% -> 85.3% * sqrt: Square root. Starts fast, slows down at the end. * outCubic * bounce: Bounces like a ball. See https://www.desmos.com/calculator/tbr20s8vd2 for a graphical representation. **Custom easing** * Use [this](http://www.timotheegroleau.com/Flash/experiments/easing_function_generator.htm) generator * Insert the given polynomial coeficients instead of t, t2, t3, t4 and t5 ``` t5*(p*p*p*p*p) + t4*(p*p*p*p) + t3*(p*p*p) + t2*(p*p) + t*p ``` Example shown with the values for easeOutElasticBig ``` easeOutElasticBig: function(p) { return 56*(p*p*p*p*p) - 175*(p*p*p*p) + 200*(p*p*p) - 100*(p*p) + 20*p; } ``` skrollr.get() ----- Returns the skrollr instance if `init()` has been called before or `undefined`. Public API ----- Calling `init()` returns an instance of skrollr which exposes a public api. ### refresh([elements]) Reparses all given `elements`. You can pass a single element or an array-like element (Array, NodeList or jQuery object) Useful when * Elements in `relative` mode change and need to be updated. * Data-attributes are manipulated dynamically. * New elements are added to the DOM and should be controlled by skrollr. When no `elements` are given, all elements in the document will be parsed again. In fact, when calling `skrollr.init()` skrollr uses `refresh()` without parameters internally. Time consuming operations, should not be called on every rendering. ### relativeToAbsolute(element, viewportAnchor, elementAnchor) Returns an integer which represents the absolute scroll position which correlates to the relative anchor. `element` must be a DOM element. `viewportAnchor` and `elementAnchor` must be one of `top`, `center` or `bottom` Example: ```js var offset = s.relativeToAbsolute(document.getElementById('foo'), 'top', 'bottom'); //offset contains the scroll position at which #foo's bottom is at the top of the viewport. //If you now use setScrollTop(offset) or animateTo(offset) #foo's bottom will be perfectly aligned with the top of the viewport. Yay. ``` ### getScrollTop() Returns the current scroll offset in pixels. Normalizes different browser quirks and handles mobile scrolling. ### getMaxScrollTop() Returns the number of pixels that can be scrolled down in total. If `forceHeight` is true, that's usually the largest keyframe. Otherwise it's the height of the document minus the viewport height. ### setScrollTop(top[, force = false]) Sets the top offset using `window.scrollTo(0, top)` on desktop or updating the internal state in case of mobile scrolling. When `force` is set to `true`, skrollr will jump to the new position without any kind of transition. By default, the global `smoothScrolling` setting applies. ### isMobile() Returns if skrollr runs in mobile mode (see also `mobileCheck` option). ### animateTo(top[, options]) Animates the scroll position from current position to `top`. Possible `options` are #### duration How long the animation should run in milliseconds. The default is `1000` or one second. #### easing The name of an easing function. The same functions can be used as for property animations. Default is `linear` . #### done A function to be called after the animation finished. When you pass a `top` value, which is the same as the current, then the function will be called immediately. The function gets a boolean argument `interrupted` which indicates if the animation was interrupted by `stopAnimateTo` or finished to the end. ### stopAnimateTo() Stops the animation and calls the `done` callback passing `true` as `interrupted` arguments. ### isAnimatingTo() Returns if an animation caused by animateTo is running. ### on(name, fn) Set a listener function for one of the events described in the options section (beforerender, render, keyframe). Only one listener can be attached at a given time. This method overwrites the current listener, if any. ### off(name) Removes the listener for the given event. ### destroy() Destroys skrollr. All `class` and `style` attributes will be set to the values they had before. Changelog ===== See [HISTORY.md](https://github.com/Prinzhorn/skrollr/blob/master/HISTORY.md). ================================================ FILE: bower.json ================================================ { "name": "skrollr", "homepage": "http://prinzhorn.github.io/skrollr/", "authors": [ "Alexander Prinzhorn" ], "description": "Stand-alone parallax scrolling library for mobile (Android + iOS) and desktop", "main": "src/skrollr.js", "moduleType": [ "globals" ], "keywords": [ "parallax", "scroll", "animation", "html5", "css3", "transition" ], "license": "MIT", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ] } ================================================ FILE: examples/README.md ================================================ Examples ------ Showcasing the awesomeness of skrollr. * [The "main" example](http://prinzhorn.github.io/skrollr/) * ["Classic" parallax with different sections and parallax images between the gaps](http://prinzhorn.github.io/skrollr/examples/classic.html) * [Demonstrating different anchors](http://prinzhorn.github.io/skrollr/examples/anchors.html) * [Demonstrating data-anchor-target](http://prinzhorn.github.io/skrollr/examples/anchor_target.html) * [Pausing the scrolling for a moment to do other animations](http://prinzhorn.github.io/skrollr/examples/pausing.html) * [Drawing a SVG path](http://prinzhorn.github.io/skrollr/examples/path.html) * [Using two custom easing functions to create a circular motion](http://prinzhorn.github.io/skrollr/examples/circular_motion.html) * [Parallax background with constant speed](http://prinzhorn.github.io/skrollr/examples/bg_constant_speed_less.html) * [gradientsmotherfucker](http://prinzhorn.github.io/skrollr/examples/gradientsmotherfucker.html) ================================================ FILE: examples/amd.html ================================================ skrollr - parallax scrolling for the masses

skrollr

parallax scrolling for the masses

let's get scrollin' ;-)

▼ ▼ ▼

transform

scale, skew and rotate the sh** out of any element

all numeric properties

width, height, padding, font-size, z-index, blah blah blah

easing?

sure.

let me dim the lights for this one...

you can set easings for each property and define own easing functions

linear
quadratic
cubic
swing
WTF
inverted
bounce

the end

by the way, you can also animate colors (you did notice this, didn't you?)

Now get this thing on GitHub and spread the word, it's open source!

Check out more examples.

Handcrafted by

================================================ FILE: examples/anchor_target.html ================================================ anchor-target

anchor-target

BLUE on the right is so unhappy. Scroll down so he can see his buddy RED.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

================================================ FILE: examples/anchors.html ================================================ Anchors

Different anchor types

Scroll down to see different anchors in action.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

start
end
bottom-top
top-bottom
top-top
bottom-bottom
center-top
center-bottom
center-center
1-center-center
50-bottom-bottom
-50-top-top

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

300-end
end

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

================================================ FILE: examples/bg_constant_speed_less.html ================================================ Background scroll - less content

Parallax background

Demo of background scrolling at constant speed independent of content height.

less content - more content


Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

================================================ FILE: examples/bg_constant_speed_more.html ================================================ Background scroll - more content

Parallax background

Demo of background scrolling at constant speed independent of content height.

less content - more content


Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

Short loin tail salami, shank andouille short ribs flank prosciutto leberkas tenderloin chuck shankle kielbasa fatback. Ball tip rump meatloaf, drumstick frankfurter tongue jowl ham hock turducken. Shoulder shank chicken, ribeye shankle venison salami andouille pork tenderloin. Pork chop t-bone flank, pig chuck meatball cow ground round meatloaf shank bacon hamburger ribeye. Pig salami pastrami, shoulder beef ribs boudin biltong drumstick. Tail pig t-bone, capicola bresaola ball tip sausage jowl flank rump kielbasa chicken speck. Shoulder turkey spare ribs sausage corned beef ground round filet mignon tenderloin tail.

Boudin shank ham hock beef, jowl brisket pork loin jerky kielbasa spare ribs andouille cow flank ground round. Jowl bacon chuck speck, swine kielbasa short loin tenderloin sausage. Pork chop short loin swine, cow tri-tip kielbasa capicola. Chicken bresaola pork chop drumstick chuck, sausage short ribs flank sirloin hamburger. Cow frankfurter chicken prosciutto sirloin ball tip, tail beef strip steak swine. Speck sirloin turducken pancetta short loin tenderloin.

Ribeye shoulder biltong venison beef tri-tip. Bresaola ham hamburger andouille turkey brisket, short loin frankfurter chicken corned beef filet mignon pancetta. Shoulder flank biltong, pork chop turkey cow jowl venison bresaola pork belly sirloin t-bone sausage swine ribeye. Sausage brisket beef, chicken spare ribs hamburger tail meatloaf pig tenderloin pork belly biltong. Pancetta tri-tip pork loin rump pastrami, drumstick flank turkey. Jowl ground round pork short ribs, boudin sirloin venison short loin pig ham.

Andouille pork chuck speck, leberkas prosciutto turducken jerky brisket frankfurter ball tip filet mignon shankle beef bacon. Turducken jowl pork biltong, andouille hamburger kielbasa. Meatball capicola shoulder ground round, ball tip spare ribs frankfurter rump t-bone beef ribs. Beef ribs brisket filet mignon pork loin kielbasa jowl, t-bone ribeye short loin spare ribs tri-tip drumstick frankfurter tenderloin ham hock. T-bone beef ham hock, speck chicken chuck biltong meatball tail bacon shank turkey flank.

Tri-tip sausage tail meatloaf. Andouille salami leberkas, shank ham ribeye sirloin drumstick. Pork pork chop shankle, jowl spare ribs beef tongue meatball tri-tip beef ribs leberkas ham turkey. Andouille pastrami flank sirloin, beef tenderloin bresaola boudin chicken speck filet mignon prosciutto. Tri-tip drumstick sausage pancetta shoulder, short loin pork chop tongue chicken ham hock salami flank cow ribeye. Chuck short ribs speck bresaola, drumstick ham capicola beef ribs tri-tip meatloaf ball tip swine. Filet mignon turducken ribeye, venison tri-tip meatloaf bacon shankle beef ball tip pork flank pig beef ribs kielbasa.

================================================ FILE: examples/circular_motion.html ================================================ Creating a circular motion (easing === awesome)
================================================ FILE: examples/classic.html ================================================ Classic parallax page
Skrollr demo of classic parallax sections. Degrades without JavaScript (could be disabled on mobile without breaking everything).

Landjaeger chicken ham fatback sausage hamburger, tri-tip capicola pastrami pancetta ribeye turducken. Rump shank turkey pig kevin sausage meatloaf tenderloin drumstick short ribs short loin. Prosciutto spare ribs chuck, pork strip steak pork chop swine bacon turkey shoulder andouille. Jowl landjaeger chicken corned beef. Ham hock kielbasa pancetta ground round sausage. Spare ribs porchetta pastrami filet mignon drumstick ball tip. Beef ribs prosciutto kevin, landjaeger shoulder ham hock ham brisket sirloin chuck t-bone drumstick kielbasa pork chop.

Landjaeger spare ribs chicken ball tip, filet mignon frankfurter ribeye tenderloin corned beef. Strip steak boudin pork loin, chicken turkey ball tip beef ribs ground round shank ham hock. Kevin capicola beef, chuck pork chop shoulder brisket doner meatloaf shank ham hock tenderloin. Chuck ham hock short ribs ground round sausage prosciutto shoulder bacon andouille tri-tip beef biltong filet mignon chicken. Pork belly andouille shank, bacon sausage meatloaf bresaola pork chop short ribs t-bone. Ham hock salami porchetta bacon beef turkey, strip steak kielbasa pancetta brisket meatball t-bone.

Chicken pancetta capicola chuck, turkey meatball jerky frankfurter kielbasa ball tip bacon ground round. Beef ribs brisket meatloaf short ribs landjaeger shankle spare ribs sausage, pancetta swine sirloin flank. Tail shank chuck pancetta, ham meatloaf short ribs sausage rump turkey kevin pork chop landjaeger. Doner boudin short ribs t-bone, jerky shankle bresaola drumstick. Strip steak shank spare ribs boudin doner short ribs. Boudin prosciutto jowl tenderloin tongue beef ribs, short ribs salami short loin strip steak ham jerky. Shank pancetta beef ribs, corned beef ham hock pork belly drumstick tail bresaola chuck.

Here be kittens
Images from http://placekitten.com/, thanks!
================================================ FILE: examples/docu/1.html ================================================ Demo 1
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
WOOOT
================================================ FILE: examples/docu/2.html ================================================ Demo 2
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
WOOOT
================================================ FILE: examples/docu/3.html ================================================ Demo 3
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
WOOOT
================================================ FILE: examples/docu/4.html ================================================ Demo 4
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
spacer
WOOOT
================================================ FILE: examples/fixed-positioning.css ================================================ /* * This file is NOT needed in order to use skrollr. * The demo uses it and it may help you as well. */ html, body { width:100%; height:100%; padding:0; margin:0; overflow-x:hidden; } .skrollable { /* * First-level skrollables are positioned relative to window */ position:fixed; /* * Skrollables by default have a z-index of 100 in order to make it easy to position elements in front/back without changing each skrollable */ z-index:100; } .skrollr-mobile .skrollable { /* May cause issues on Android default browser (see #331 on GitHub). */ position:absolute; } .skrollable .skrollable { /* * Second-level skrollables are positioned relative their parent skrollable */ position:absolute; } .skrollable .skrollable .skrollable { /* * Third-level (and below) skrollables are positioned static */ position:static; } ================================================ FILE: examples/fixed_nav.html ================================================ Fixed nav (desktop only!)

Fixed nav (desktop only!)

 

Scroll down to see the nav getting fixed.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow fatback short loin, hamburger speck jowl turducken capicola ham hock. Hamburger corned beef strip steak shank filet mignon, jerky capicola chicken jowl ribeye pork ham hock ground round bresaola. Jowl ribeye kielbasa drumstick pork belly leberkas. Spare ribs fatback shankle, hamburger meatloaf sausage pork loin andouille pork kielbasa. Pancetta shank tongue, leberkas turducken shoulder rump meatball pork belly pig hamburger brisket biltong. Tenderloin short ribs pig, rump tail chuck turducken.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

Biltong pastrami kielbasa short ribs, turducken shoulder pork chop boudin ground round speck cow. Fatback leberkas shank hamburger, tail pork belly tongue bresaola short ribs corned beef speck tri-tip ribeye. Filet mignon shoulder speck pastrami. Ham hock turducken corned beef shankle. Meatloaf shankle sausage boudin, shank flank turducken tenderloin pancetta ball tip. Biltong boudin jowl drumstick pig.

Sirloin venison bresaola andouille pastrami short ribs. Short loin cow capicola tail ham hock leberkas. Frankfurter meatloaf capicola, swine ball tip jerky pork loin pork belly cow ribeye brisket strip steak jowl beef ribs ham hock. Pastrami ham hock rump turkey, pork belly capicola jerky. Turkey chuck beef, bresaola filet mignon jerky tri-tip pastrami. Bacon capicola jowl fatback short ribs. Speck shankle bacon chuck.

Pork loin tail pork belly shank ham. Kielbasa venison ham, short loin ham hock beef ribs tri-tip ball tip pork belly. Ribeye sirloin sausage tenderloin hamburger. Strip steak tongue turkey, andouille bacon beef ribs venison. T-bone ball tip bresaola fatback, ground round meatball chicken sausage tongue pork chop leberkas sirloin jerky shank bacon. Turducken sirloin cow shankle pig, leberkas venison boudin pastrami.

Cow tri-tip pork loin salami corned beef. T-bone turkey ham frankfurter, brisket cow chicken bacon rump sirloin. Pancetta ribeye salami leberkas speck shank. Ribeye prosciutto swine venison speck beef.

================================================ FILE: examples/gradientsmotherfucker.html ================================================ What’s the best way to appease Samuel L. Jackson’s design-lust?

What’s the best way to appease Samuel L. Jackson’s design-lust?

Scroll to find out

Rotating gradients, motherfucker

Inspired by: http://gradientsmotherfucker.com/

Created with: skrollr

================================================ FILE: examples/main.css ================================================ html, body, div, span, p, a, del, em, img, ol, ul, li, fieldset, form, label { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } html, body { line-height: 1; min-height:100%; font-family:Artial, Verdana, sans-serif; } body { background: #eeeeee; background: -webkit-linear-gradient(top, #eeeeee, #cccccc 100%); background: -moz-linear-gradient(top, #eeeeee, #cccccc 100%); background: -o-linear-gradient(top, #eeeeee, #cccccc 100%); background: -ms-linear-gradient(top, #eeeeee, #cccccc 100%); background: linear-gradient(top, #eeeeee, #cccccc 100%); background-attachment:fixed; } ol, ul { list-style: none; } p { margin:1em 0; line-height:1.1em; } q { font-style:italic; color:#333; } h1 { font-size:2.91em; margin:0; } h1 > small { text-align:right; display:inline-block; font-size:.71em; text-indent:15em; color:#444; } h2 { color:inherit; font-size:1.91em; margin:2em 0 1em 0; } h2:first-child {margin-top:0;} h3 { color:#333; font-size:1.41em; margin:1em 0; } h4 { color:#444; font-size:1.11em; margin:1em 0; } #progress { height:2%; background:#444; bottom:0; z-index:200; } #scrollbar { position:fixed; right:2px; height:50px; width:6px; background:#444; background:rgba(0,0,0,0.6); border:1px solid rgba(255,255,255,0.6); z-index:300; border-radius:3px; } .skrollr-desktop #scrollbar {display:none;} #bg1, #bg2, #bg3 { z-index:50; top:0; left:0; width:100%; height:100%; background:url(images/bubbles.png) repeat 0 0; } #bg2 { z-index:49; background-image:url(images/bubbles2.png); } #bg3 { z-index:48; background-image:url(images/bubbles3.png); } #intro { width:80%; left:50%; top:1em; margin-left:-40%; padding:2em; background:#fff; text-align:center; border-radius:1em; -webkit-transform-origin:0 0; -moz-transform-origin:0 0; -ms-transform-origin:0 0; -o-transform-origin:0 0; transform-origin:0 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #intro .arrows { font-size:2em; color:#09f; } #transform { width:70%; left:50%; top:20%; margin-left:-35%; text-align:center; font-size:150%; .transform-origin(50%, 50%); } #properties { width:100%; height:100%; padding-top:10%; text-align:center; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #easing_wrapper { width:100%; height:100%; } #easing { top:10%; width:50%; z-index:101; } .drop { background:#09f; font-weight:bold; padding:1em; } #download { width:80%; left:10%; height:80%; padding:3em; border:0 solid #222; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .twitter-share-button, .twitter-follow-button { vertical-align:middle; } ================================================ FILE: examples/path.html ================================================ Drawing a path

SVG IS AWESOME (so is skrollr)

Scroll down for details

WOOOT!

WOOOT!

WOOOT!

WOOOT!

WOOOT!

WOOOT!

WOOOT!

WOOOT!

WOOOT!

================================================ FILE: examples/pausing.html ================================================ Pausing
================================================ FILE: examples/scripts/main.js ================================================ require.config({ baseUrl: "../dist", paths: { 'skrollr' : "skrollr.min" }, waitSeconds: 15 }); require(['skrollr'], function(skrollr){ var s = skrollr.init({ edgeStrategy: 'set', easing: { WTF: Math.random, inverted: function(p) { return 1-p; } } }); }); ================================================ FILE: examples/scripts/require.js ================================================ /* RequireJS 2.1.9 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. Available via the MIT or new BSD license. see: http://github.com/jrburke/requirejs for details */ var requirejs,require,define; (function(Z){function H(b){return"[object Function]"===L.call(b)}function I(b){return"[object Array]"===L.call(b)}function y(b,c){if(b){var e;for(e=0;ethis.depCount&&!this.defined){if(H(m)){if(this.events.error&&this.map.isDefine||j.onError!==aa)try{d=i.execCb(c,m,b,d)}catch(e){a=e}else d=i.execCb(c,m,b,d);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!== this.exports?d=b.exports:void 0===d&&this.usingExports&&(d=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",v(this.error=a)}else d=m;this.exports=d;if(this.map.isDefine&&!this.ignore&&(r[c]=d,j.onResourceLoad))j.onResourceLoad(i,this.map,this.depMaps);x(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete= !0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,e=n(a.prefix);this.depMaps.push(e);s(e,"defined",u(this,function(d){var m,e;e=this.map.name;var g=this.map.parentMap?this.map.parentMap.name:null,h=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(d.normalize&&(e=d.normalize(e,function(a){return c(a,g,!0)})||""),d=n(a.prefix+"!"+e,this.map.parentMap),s(d,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})), e=l(p,d.id)){this.depMaps.push(d);if(this.events.error)e.on("error",u(this,function(a){this.emit("error",a)}));e.enable()}}else m=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),m.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];F(p,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&x(a.map.id)});v(a)}),m.fromText=u(this,function(d,c){var e=a.name,g=n(e),B=O;c&&(d=c);B&&(O=!1);q(g);t(k.config,b)&&(k.config[e]=k.config[b]);try{j.exec(d)}catch(ca){return v(A("fromtexteval", "fromText eval for "+b+" failed: "+ca,ca,[b]))}B&&(O=!0);this.depMaps.push(g);i.completeLoad(e);h([e],m)}),d.load(a.name,h,m,k)}));i.enable(e,this);this.pluginMaps[e.id]=e},enable:function(){T[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,u(this,function(a,b){var c,d;if("string"===typeof a){a=n(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=l(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;s(a,"defined",u(this,function(a){this.defineDep(b, a);this.check()}));this.errback&&s(a,"error",u(this,this.errback))}c=a.id;d=p[c];!t(N,c)&&(d&&!d.enabled)&&i.enable(a,this)}));F(this.pluginMaps,u(this,function(a){var b=l(p,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:k,contextName:b,registry:p,defined:r,urlFetched:S,defQueue:G,Module:X,makeModuleMap:n, nextTick:j.nextTick,onError:v,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=k.pkgs,c=k.shim,d={paths:!0,config:!0,map:!0};F(a,function(a,b){d[b]?"map"===b?(k.map||(k.map={}),Q(k[b],a,!0,!0)):Q(k[b],a,!0):k[b]=a});a.shim&&(F(a.shim,function(a,b){I(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);c[b]=a}),k.shim=c);a.packages&&(y(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name, location:a.location||a.name,main:(a.main||"main").replace(ja,"").replace(ea,"")}}),k.pkgs=b);F(p,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=n(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(Z,arguments));return b||a.exports&&ba(a.exports)}},makeRequire:function(a,f){function h(d,c,e){var g,k;f.enableBuildCallback&&(c&&H(c))&&(c.__requireJsBuild=!0);if("string"===typeof d){if(H(c))return v(A("requireargs", "Invalid require call"),e);if(a&&t(N,d))return N[d](p[a.id]);if(j.get)return j.get(i,d,a,h);g=n(d,a,!1,!0);g=g.id;return!t(r,g)?v(A("notloaded",'Module name "'+g+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[g]}K();i.nextTick(function(){K();k=q(n(null,a));k.skipMap=f.skipMap;k.init(d,c,e,{enabled:!0});C()});return h}f=f||{};Q(h,{isBrowser:z,toUrl:function(b){var f,e=b.lastIndexOf("."),g=b.split("/")[0];if(-1!==e&&(!("."===g||".."===g)||1h.attachEvent.toString().indexOf("[native code"))&&!W?(O=!0,h.attachEvent("onreadystatechange",b.onScriptLoad)):(h.addEventListener("load",b.onScriptLoad,!1),h.addEventListener("error", b.onScriptError,!1)),h.src=e,K=h,C?x.insertBefore(h,C):x.appendChild(h),K=null,h;if(da)try{importScripts(e),b.completeLoad(c)}catch(l){b.onError(A("importscripts","importScripts failed for "+c+" at "+e,l,[c]))}};z&&!s.skipDataMain&&M(document.getElementsByTagName("script"),function(b){x||(x=b.parentNode);if(J=b.getAttribute("data-main"))return q=J,s.baseUrl||(D=q.split("/"),q=D.pop(),fa=D.length?D.join("/")+"/":"./",s.baseUrl=fa),q=q.replace(ea,""),j.jsExtRegExp.test(q)&&(q=J),s.deps=s.deps?s.deps.concat(q): [q],!0});define=function(b,c,e){var h,j;"string"!==typeof b&&(e=c,c=b,b=null);I(c)||(e=c,c=null);!c&&H(e)&&(c=[],e.length&&(e.toString().replace(la,"").replace(ma,function(b,e){c.push(e)}),c=(1===e.length?["require"]:["require","exports","module"]).concat(c)));if(O){if(!(h=K))P&&"interactive"===P.readyState||M(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),h=P;h&&(b||(b=h.getAttribute("data-requiremodule")),j=E[h.getAttribute("data-requirecontext")])}(j? j.defQueue:R).push([b,c,e])};define.amd={jQuery:!0};j.exec=function(b){return eval(b)};j(s)}})(this); ================================================ FILE: examples/svg.html ================================================ SVG ================================================ FILE: index.html ================================================ skrollr - parallax scrolling for the masses

skrollr

parallax scrolling for the masses

let's get scrollin' ;-)

▼ ▼ ▼

transform

scale, skew and rotate the sh** out of any element

all numeric properties

width, height, padding, font-size, z-index, blah blah blah

easing?

sure.

let me dim the lights for this one...

you can set easings for each property and define own easing functions

linear
quadratic
cubic
swing
WTF
inverted
bounce

the end

by the way, you can also animate colors (you did notice this, didn't you?)

Now get this thing on GitHub and spread the word, it's open source!

Check out more examples.

Handcrafted by

================================================ FILE: package.json ================================================ { "name": "skrollr", "title": "skrollr", "description": "Stand-alone parallax scrolling library with zero dependencies.", "version": "0.6.30", "homepage": "https://github.com/Prinzhorn/skrollr", "author": { "name": "Alexander Prinzhorn", "email": "alexander@prinzhorn.it", "url": "http://www.prinzhorn.it/" }, "repository": { "type": "git", "url": "git://github.com/Prinzhorn/skrollr.git" }, "bugs": { "url": "https://github.com/Prinzhorn/skrollr/issues" }, "licenses": [ { "type": "MIT", "url": "https://github.com/Prinzhorn/skrollr/blob/master/LICENSE.txt" } ], "main": "dist/skrollr.min.js", "engines": { "node": "0.10.x" }, "scripts": { "test": "grunt travis --verbose" }, "devDependencies": { "grunt-cli": "~0.1.7", "grunt": "~0.4.1", "grunt-contrib-uglify": "~0.2.0", "grunt-contrib-jshint": "~0.3.0", "grunt-contrib-qunit": "~0.2.0" }, "keywords": [] } ================================================ FILE: shim.html ================================================ Your title
================================================ FILE: src/skrollr.js ================================================ /*! * skrollr core * * Alexander Prinzhorn - https://github.com/Prinzhorn/skrollr * * Free to use under terms of MIT license */ (function(window, document, undefined) { 'use strict'; /* * Global api. */ var skrollr = { get: function() { return _instance; }, //Main entry point. init: function(options) { return _instance || new Skrollr(options); }, VERSION: '0.6.30' }; //Minify optimization. var hasProp = Object.prototype.hasOwnProperty; var Math = window.Math; var getStyle = window.getComputedStyle; //They will be filled when skrollr gets initialized. var documentElement; var body; var EVENT_TOUCHSTART = 'touchstart'; var EVENT_TOUCHMOVE = 'touchmove'; var EVENT_TOUCHCANCEL = 'touchcancel'; var EVENT_TOUCHEND = 'touchend'; var SKROLLABLE_CLASS = 'skrollable'; var SKROLLABLE_BEFORE_CLASS = SKROLLABLE_CLASS + '-before'; var SKROLLABLE_BETWEEN_CLASS = SKROLLABLE_CLASS + '-between'; var SKROLLABLE_AFTER_CLASS = SKROLLABLE_CLASS + '-after'; var SKROLLR_CLASS = 'skrollr'; var NO_SKROLLR_CLASS = 'no-' + SKROLLR_CLASS; var SKROLLR_DESKTOP_CLASS = SKROLLR_CLASS + '-desktop'; var SKROLLR_MOBILE_CLASS = SKROLLR_CLASS + '-mobile'; var DEFAULT_EASING = 'linear'; var DEFAULT_DURATION = 1000;//ms var DEFAULT_MOBILE_DECELERATION = 0.004;//pixel/ms² var DEFAULT_SKROLLRBODY = 'skrollr-body'; var DEFAULT_SMOOTH_SCROLLING_DURATION = 200;//ms var ANCHOR_START = 'start'; var ANCHOR_END = 'end'; var ANCHOR_CENTER = 'center'; var ANCHOR_BOTTOM = 'bottom'; //The property which will be added to the DOM element to hold the ID of the skrollable. var SKROLLABLE_ID_DOM_PROPERTY = '___skrollable_id'; var rxTouchIgnoreTags = /^(?:input|textarea|button|select)$/i; var rxTrim = /^\s+|\s+$/g; //Find all data-attributes. data-[_constant]-[offset]-[anchor]-[anchor]. var rxKeyframeAttribute = /^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/; var rxPropValue = /\s*(@?[\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi; //Easing function names follow the property in square brackets. var rxPropEasing = /^(@?[a-z\-]+)\[(\w+)\]$/; var rxCamelCase = /-([a-z0-9_])/g; var rxCamelCaseFn = function(str, letter) { return letter.toUpperCase(); }; //Numeric values with optional sign. var rxNumericValue = /[\-+]?[\d]*\.?[\d]+/g; //Used to replace occurences of {?} with a number. var rxInterpolateString = /\{\?\}/g; //Finds rgb(a) colors, which don't use the percentage notation. var rxRGBAIntegerColor = /rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g; //Finds all gradients. var rxGradient = /[a-z\-]+-gradient/g; //Vendor prefix. Will be set once skrollr gets initialized. var theCSSPrefix = ''; var theDashedCSSPrefix = ''; //Will be called once (when skrollr gets initialized). var detectCSSPrefix = function() { //Only relevant prefixes. May be extended. //Could be dangerous if there will ever be a CSS property which actually starts with "ms". Don't hope so. var rxPrefixes = /^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/; //Detect prefix for current browser by finding the first property using a prefix. if(!getStyle) { return; } var style = getStyle(body, null); for(var k in style) { //We check the key and if the key is a number, we check the value as well, because safari's getComputedStyle returns some weird array-like thingy. theCSSPrefix = (k.match(rxPrefixes) || (+k == k && style[k].match(rxPrefixes))); if(theCSSPrefix) { break; } } //Did we even detect a prefix? if(!theCSSPrefix) { theCSSPrefix = theDashedCSSPrefix = ''; return; } theCSSPrefix = theCSSPrefix[0]; //We could have detected either a dashed prefix or this camelCaseish-inconsistent stuff. if(theCSSPrefix.slice(0,1) === '-') { theDashedCSSPrefix = theCSSPrefix; //There's no logic behind these. Need a look up. theCSSPrefix = ({ '-webkit-': 'webkit', '-moz-': 'Moz', '-ms-': 'ms', '-o-': 'O' })[theCSSPrefix]; } else { theDashedCSSPrefix = '-' + theCSSPrefix.toLowerCase() + '-'; } }; var polyfillRAF = function() { var requestAnimFrame = window.requestAnimationFrame || window[theCSSPrefix.toLowerCase() + 'RequestAnimationFrame']; var lastTime = _now(); if(_isMobile || !requestAnimFrame) { requestAnimFrame = function(callback) { //How long did it take to render? var deltaTime = _now() - lastTime; var delay = Math.max(0, 1000 / 60 - deltaTime); return window.setTimeout(function() { lastTime = _now(); callback(); }, delay); }; } return requestAnimFrame; }; var polyfillCAF = function() { var cancelAnimFrame = window.cancelAnimationFrame || window[theCSSPrefix.toLowerCase() + 'CancelAnimationFrame']; if(_isMobile || !cancelAnimFrame) { cancelAnimFrame = function(timeout) { return window.clearTimeout(timeout); }; } return cancelAnimFrame; }; //Built-in easing functions. var easings = { begin: function() { return 0; }, end: function() { return 1; }, linear: function(p) { return p; }, quadratic: function(p) { return p * p; }, cubic: function(p) { return p * p * p; }, swing: function(p) { return (-Math.cos(p * Math.PI) / 2) + 0.5; }, sqrt: function(p) { return Math.sqrt(p); }, outCubic: function(p) { return (Math.pow((p - 1), 3) + 1); }, //see https://www.desmos.com/calculator/tbr20s8vd2 for how I did this bounce: function(p) { var a; if(p <= 0.5083) { a = 3; } else if(p <= 0.8489) { a = 9; } else if(p <= 0.96208) { a = 27; } else if(p <= 0.99981) { a = 91; } else { return 1; } return 1 - Math.abs(3 * Math.cos(p * a * 1.028) / a); } }; /** * Constructor. */ function Skrollr(options) { documentElement = document.documentElement; body = document.body; detectCSSPrefix(); _instance = this; options = options || {}; _constants = options.constants || {}; //We allow defining custom easings or overwrite existing. if(options.easing) { for(var e in options.easing) { easings[e] = options.easing[e]; } } _edgeStrategy = options.edgeStrategy || 'set'; _listeners = { //Function to be called right before rendering. beforerender: options.beforerender, //Function to be called right after finishing rendering. render: options.render, //Function to be called whenever an element with the `data-emit-events` attribute passes a keyframe. keyframe: options.keyframe }; //forceHeight is true by default _forceHeight = options.forceHeight !== false; if(_forceHeight) { _scale = options.scale || 1; } _mobileDeceleration = options.mobileDeceleration || DEFAULT_MOBILE_DECELERATION; _smoothScrollingEnabled = options.smoothScrolling !== false; _smoothScrollingDuration = options.smoothScrollingDuration || DEFAULT_SMOOTH_SCROLLING_DURATION; //Dummy object. Will be overwritten in the _render method when smooth scrolling is calculated. _smoothScrolling = { targetTop: _instance.getScrollTop() }; //A custom check function may be passed. _isMobile = ((options.mobileCheck || function() { return (/Android|iPhone|iPad|iPod|BlackBerry/i).test(navigator.userAgent || navigator.vendor || window.opera); })()); if(_isMobile) { _skrollrBody = document.getElementById(options.skrollrBody || DEFAULT_SKROLLRBODY); //Detect 3d transform if there's a skrollr-body (only needed for #skrollr-body). if(_skrollrBody) { _detect3DTransforms(); } _initMobile(); _updateClass(documentElement, [SKROLLR_CLASS, SKROLLR_MOBILE_CLASS], [NO_SKROLLR_CLASS]); } else { _updateClass(documentElement, [SKROLLR_CLASS, SKROLLR_DESKTOP_CLASS], [NO_SKROLLR_CLASS]); } //Triggers parsing of elements and a first reflow. _instance.refresh(); _addEvent(window, 'resize orientationchange', function() { var width = documentElement.clientWidth; var height = documentElement.clientHeight; //Only reflow if the size actually changed (#271). if(height !== _lastViewportHeight || width !== _lastViewportWidth) { _lastViewportHeight = height; _lastViewportWidth = width; _requestReflow = true; } }); var requestAnimFrame = polyfillRAF(); //Let's go. (function animloop(){ _render(); _animFrame = requestAnimFrame(animloop); }()); return _instance; } /** * (Re)parses some or all elements. */ Skrollr.prototype.refresh = function(elements) { var elementIndex; var elementsLength; var ignoreID = false; //Completely reparse anything without argument. if(elements === undefined) { //Ignore that some elements may already have a skrollable ID. ignoreID = true; _skrollables = []; _skrollableIdCounter = 0; elements = document.getElementsByTagName('*'); } else if(elements.length === undefined) { //We also accept a single element as parameter. elements = [elements]; } elementIndex = 0; elementsLength = elements.length; for(; elementIndex < elementsLength; elementIndex++) { var el = elements[elementIndex]; var anchorTarget = el; var keyFrames = []; //If this particular element should be smooth scrolled. var smoothScrollThis = _smoothScrollingEnabled; //The edge strategy for this particular element. var edgeStrategy = _edgeStrategy; //If this particular element should emit keyframe events. var emitEvents = false; //If we're reseting the counter, remove any old element ids that may be hanging around. if(ignoreID && SKROLLABLE_ID_DOM_PROPERTY in el) { delete el[SKROLLABLE_ID_DOM_PROPERTY]; } if(!el.attributes) { continue; } //Iterate over all attributes and search for key frame attributes. var attributeIndex = 0; var attributesLength = el.attributes.length; for (; attributeIndex < attributesLength; attributeIndex++) { var attr = el.attributes[attributeIndex]; if(attr.name === 'data-anchor-target') { anchorTarget = document.querySelector(attr.value); if(anchorTarget === null) { throw 'Unable to find anchor target "' + attr.value + '"'; } continue; } //Global smooth scrolling can be overridden by the element attribute. if(attr.name === 'data-smooth-scrolling') { smoothScrollThis = attr.value !== 'off'; continue; } //Global edge strategy can be overridden by the element attribute. if(attr.name === 'data-edge-strategy') { edgeStrategy = attr.value; continue; } //Is this element tagged with the `data-emit-events` attribute? if(attr.name === 'data-emit-events') { emitEvents = true; continue; } var match = attr.name.match(rxKeyframeAttribute); if(match === null) { continue; } var kf = { props: attr.value, //Point back to the element as well. element: el, //The name of the event which this keyframe will fire, if emitEvents is eventType: attr.name.replace(rxCamelCase, rxCamelCaseFn) }; keyFrames.push(kf); var constant = match[1]; if(constant) { //Strip the underscore prefix. kf.constant = constant.substr(1); } //Get the key frame offset. var offset = match[2]; //Is it a percentage offset? if(/p$/.test(offset)) { kf.isPercentage = true; kf.offset = (offset.slice(0, -1) | 0) / 100; } else { kf.offset = (offset | 0); } var anchor1 = match[3]; //If second anchor is not set, the first will be taken for both. var anchor2 = match[4] || anchor1; //"absolute" (or "classic") mode, where numbers mean absolute scroll offset. if(!anchor1 || anchor1 === ANCHOR_START || anchor1 === ANCHOR_END) { kf.mode = 'absolute'; //data-end needs to be calculated after all key frames are known. if(anchor1 === ANCHOR_END) { kf.isEnd = true; } else if(!kf.isPercentage) { //For data-start we can already set the key frame w/o calculations. //#59: "scale" options should only affect absolute mode. kf.offset = kf.offset * _scale; } } //"relative" mode, where numbers are relative to anchors. else { kf.mode = 'relative'; kf.anchors = [anchor1, anchor2]; } } //Does this element have key frames? if(!keyFrames.length) { continue; } //Will hold the original style and class attributes before we controlled the element (see #80). var styleAttr, classAttr; var id; if(!ignoreID && SKROLLABLE_ID_DOM_PROPERTY in el) { //We already have this element under control. Grab the corresponding skrollable id. id = el[SKROLLABLE_ID_DOM_PROPERTY]; styleAttr = _skrollables[id].styleAttr; classAttr = _skrollables[id].classAttr; } else { //It's an unknown element. Asign it a new skrollable id. id = (el[SKROLLABLE_ID_DOM_PROPERTY] = _skrollableIdCounter++); styleAttr = el.style.cssText; classAttr = _getClass(el); } _skrollables[id] = { element: el, styleAttr: styleAttr, classAttr: classAttr, anchorTarget: anchorTarget, keyFrames: keyFrames, smoothScrolling: smoothScrollThis, edgeStrategy: edgeStrategy, emitEvents: emitEvents, lastFrameIndex: -1 }; _updateClass(el, [SKROLLABLE_CLASS], []); } //Reflow for the first time. _reflow(); //Now that we got all key frame numbers right, actually parse the properties. elementIndex = 0; elementsLength = elements.length; for(; elementIndex < elementsLength; elementIndex++) { var sk = _skrollables[elements[elementIndex][SKROLLABLE_ID_DOM_PROPERTY]]; if(sk === undefined) { continue; } //Parse the property string to objects _parseProps(sk); //Fill key frames with missing properties from left and right _fillProps(sk); } return _instance; }; /** * Transform "relative" mode to "absolute" mode. * That is, calculate anchor position and offset of element. */ Skrollr.prototype.relativeToAbsolute = function(element, viewportAnchor, elementAnchor) { var viewportHeight = documentElement.clientHeight; var box = element.getBoundingClientRect(); var absolute = box.top; //#100: IE doesn't supply "height" with getBoundingClientRect. var boxHeight = box.bottom - box.top; if(viewportAnchor === ANCHOR_BOTTOM) { absolute -= viewportHeight; } else if(viewportAnchor === ANCHOR_CENTER) { absolute -= viewportHeight / 2; } if(elementAnchor === ANCHOR_BOTTOM) { absolute += boxHeight; } else if(elementAnchor === ANCHOR_CENTER) { absolute += boxHeight / 2; } //Compensate scrolling since getBoundingClientRect is relative to viewport. absolute += _instance.getScrollTop(); return (absolute + 0.5) | 0; }; /** * Animates scroll top to new position. */ Skrollr.prototype.animateTo = function(top, options) { options = options || {}; var now = _now(); var scrollTop = _instance.getScrollTop(); var duration = options.duration === undefined ? DEFAULT_DURATION : options.duration; //Setting this to a new value will automatically cause the current animation to stop, if any. _scrollAnimation = { startTop: scrollTop, topDiff: top - scrollTop, targetTop: top, duration: duration, startTime: now, endTime: now + duration, easing: easings[options.easing || DEFAULT_EASING], done: options.done }; //Don't queue the animation if there's nothing to animate. if(!_scrollAnimation.topDiff) { if(_scrollAnimation.done) { _scrollAnimation.done.call(_instance, false); } _scrollAnimation = undefined; } return _instance; }; /** * Stops animateTo animation. */ Skrollr.prototype.stopAnimateTo = function() { if(_scrollAnimation && _scrollAnimation.done) { _scrollAnimation.done.call(_instance, true); } _scrollAnimation = undefined; }; /** * Returns if an animation caused by animateTo is currently running. */ Skrollr.prototype.isAnimatingTo = function() { return !!_scrollAnimation; }; Skrollr.prototype.isMobile = function() { return _isMobile; }; Skrollr.prototype.setScrollTop = function(top, force) { _forceRender = (force === true); if(_isMobile) { _mobileOffset = Math.min(Math.max(top, 0), _maxKeyFrame); } else { window.scrollTo(0, top); } return _instance; }; Skrollr.prototype.getScrollTop = function() { if(_isMobile) { return _mobileOffset; } else { return window.pageYOffset || documentElement.scrollTop || body.scrollTop || 0; } }; Skrollr.prototype.getMaxScrollTop = function() { return _maxKeyFrame; }; Skrollr.prototype.on = function(name, fn) { _listeners[name] = fn; return _instance; }; Skrollr.prototype.off = function(name) { delete _listeners[name]; return _instance; }; Skrollr.prototype.destroy = function() { var cancelAnimFrame = polyfillCAF(); cancelAnimFrame(_animFrame); _removeAllEvents(); _updateClass(documentElement, [NO_SKROLLR_CLASS], [SKROLLR_CLASS, SKROLLR_DESKTOP_CLASS, SKROLLR_MOBILE_CLASS]); var skrollableIndex = 0; var skrollablesLength = _skrollables.length; for(; skrollableIndex < skrollablesLength; skrollableIndex++) { _reset(_skrollables[skrollableIndex].element); } documentElement.style.overflow = body.style.overflow = ''; documentElement.style.height = body.style.height = ''; if(_skrollrBody) { skrollr.setStyle(_skrollrBody, 'transform', 'none'); } _instance = undefined; _skrollrBody = undefined; _listeners = undefined; _forceHeight = undefined; _maxKeyFrame = 0; _scale = 1; _constants = undefined; _mobileDeceleration = undefined; _direction = 'down'; _lastTop = -1; _lastViewportWidth = 0; _lastViewportHeight = 0; _requestReflow = false; _scrollAnimation = undefined; _smoothScrollingEnabled = undefined; _smoothScrollingDuration = undefined; _smoothScrolling = undefined; _forceRender = undefined; _skrollableIdCounter = 0; _edgeStrategy = undefined; _isMobile = false; _mobileOffset = 0; _translateZ = undefined; }; /* Private methods. */ var _initMobile = function() { var initialElement; var initialTouchY; var initialTouchX; var currentElement; var currentTouchY; var currentTouchX; var lastTouchY; var deltaY; var initialTouchTime; var currentTouchTime; var lastTouchTime; var deltaTime; _addEvent(documentElement, [EVENT_TOUCHSTART, EVENT_TOUCHMOVE, EVENT_TOUCHCANCEL, EVENT_TOUCHEND].join(' '), function(e) { var touch = e.changedTouches[0]; currentElement = e.target; //We don't want text nodes. while(currentElement.nodeType === 3) { currentElement = currentElement.parentNode; } currentTouchY = touch.clientY; currentTouchX = touch.clientX; currentTouchTime = e.timeStamp; if(!rxTouchIgnoreTags.test(currentElement.tagName)) { e.preventDefault(); } switch(e.type) { case EVENT_TOUCHSTART: //The last element we tapped on. if(initialElement) { initialElement.blur(); } _instance.stopAnimateTo(); initialElement = currentElement; initialTouchY = lastTouchY = currentTouchY; initialTouchX = currentTouchX; initialTouchTime = currentTouchTime; break; case EVENT_TOUCHMOVE: //Prevent default event on touchIgnore elements in case they don't have focus yet. if(rxTouchIgnoreTags.test(currentElement.tagName) && document.activeElement !== currentElement) { e.preventDefault(); } deltaY = currentTouchY - lastTouchY; deltaTime = currentTouchTime - lastTouchTime; _instance.setScrollTop(_mobileOffset - deltaY, true); lastTouchY = currentTouchY; lastTouchTime = currentTouchTime; break; default: case EVENT_TOUCHCANCEL: case EVENT_TOUCHEND: var distanceY = initialTouchY - currentTouchY; var distanceX = initialTouchX - currentTouchX; var distance2 = distanceX * distanceX + distanceY * distanceY; //Check if it was more like a tap (moved less than 7px). if(distance2 < 49) { if(!rxTouchIgnoreTags.test(initialElement.tagName)) { initialElement.focus(); //It was a tap, click the element. var clickEvent = document.createEvent('MouseEvents'); clickEvent.initMouseEvent('click', true, true, e.view, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, 0, null); initialElement.dispatchEvent(clickEvent); } return; } initialElement = undefined; var speed = deltaY / deltaTime; //Cap speed at 3 pixel/ms. speed = Math.max(Math.min(speed, 3), -3); var duration = Math.abs(speed / _mobileDeceleration); var targetOffset = speed * duration + 0.5 * _mobileDeceleration * duration * duration; var targetTop = _instance.getScrollTop() - targetOffset; //Relative duration change for when scrolling above bounds. var targetRatio = 0; //Change duration proportionally when scrolling would leave bounds. if(targetTop > _maxKeyFrame) { targetRatio = (_maxKeyFrame - targetTop) / targetOffset; targetTop = _maxKeyFrame; } else if(targetTop < 0) { targetRatio = -targetTop / targetOffset; targetTop = 0; } duration = duration * (1 - targetRatio); _instance.animateTo((targetTop + 0.5) | 0, {easing: 'outCubic', duration: duration}); break; } }); //Just in case there has already been some native scrolling, reset it. window.scrollTo(0, 0); documentElement.style.overflow = body.style.overflow = 'hidden'; }; /** * Updates key frames which depend on others / need to be updated on resize. * That is "end" in "absolute" mode and all key frames in "relative" mode. * Also handles constants, because they may change on resize. */ var _updateDependentKeyFrames = function() { var viewportHeight = documentElement.clientHeight; var processedConstants = _processConstants(); var skrollable; var element; var anchorTarget; var keyFrames; var keyFrameIndex; var keyFramesLength; var kf; var skrollableIndex; var skrollablesLength; var offset; var constantValue; //First process all relative-mode elements and find the max key frame. skrollableIndex = 0; skrollablesLength = _skrollables.length; for(; skrollableIndex < skrollablesLength; skrollableIndex++) { skrollable = _skrollables[skrollableIndex]; element = skrollable.element; anchorTarget = skrollable.anchorTarget; keyFrames = skrollable.keyFrames; keyFrameIndex = 0; keyFramesLength = keyFrames.length; for(; keyFrameIndex < keyFramesLength; keyFrameIndex++) { kf = keyFrames[keyFrameIndex]; offset = kf.offset; constantValue = processedConstants[kf.constant] || 0; kf.frame = offset; if(kf.isPercentage) { //Convert the offset to percentage of the viewport height. offset = offset * viewportHeight; //Absolute + percentage mode. kf.frame = offset; } if(kf.mode === 'relative') { _reset(element); kf.frame = _instance.relativeToAbsolute(anchorTarget, kf.anchors[0], kf.anchors[1]) - offset; _reset(element, true); } kf.frame += constantValue; //Only search for max key frame when forceHeight is enabled. if(_forceHeight) { //Find the max key frame, but don't use one of the data-end ones for comparison. if(!kf.isEnd && kf.frame > _maxKeyFrame) { _maxKeyFrame = kf.frame; } } } } //#133: The document can be larger than the maxKeyFrame we found. _maxKeyFrame = Math.max(_maxKeyFrame, _getDocumentHeight()); //Now process all data-end keyframes. skrollableIndex = 0; skrollablesLength = _skrollables.length; for(; skrollableIndex < skrollablesLength; skrollableIndex++) { skrollable = _skrollables[skrollableIndex]; keyFrames = skrollable.keyFrames; keyFrameIndex = 0; keyFramesLength = keyFrames.length; for(; keyFrameIndex < keyFramesLength; keyFrameIndex++) { kf = keyFrames[keyFrameIndex]; constantValue = processedConstants[kf.constant] || 0; if(kf.isEnd) { kf.frame = _maxKeyFrame - kf.offset + constantValue; } } skrollable.keyFrames.sort(_keyFrameComparator); } }; /** * Calculates and sets the style properties for the element at the given frame. * @param fakeFrame The frame to render at when smooth scrolling is enabled. * @param actualFrame The actual frame we are at. */ var _calcSteps = function(fakeFrame, actualFrame) { //Iterate over all skrollables. var skrollableIndex = 0; var skrollablesLength = _skrollables.length; for(; skrollableIndex < skrollablesLength; skrollableIndex++) { var skrollable = _skrollables[skrollableIndex]; var element = skrollable.element; var frame = skrollable.smoothScrolling ? fakeFrame : actualFrame; var frames = skrollable.keyFrames; var framesLength = frames.length; var firstFrame = frames[0]; var lastFrame = frames[frames.length - 1]; var beforeFirst = frame < firstFrame.frame; var afterLast = frame > lastFrame.frame; var firstOrLastFrame = beforeFirst ? firstFrame : lastFrame; var emitEvents = skrollable.emitEvents; var lastFrameIndex = skrollable.lastFrameIndex; var key; var value; //If we are before/after the first/last frame, set the styles according to the given edge strategy. if(beforeFirst || afterLast) { //Check if we already handled this edge case last time. //Note: using setScrollTop it's possible that we jumped from one edge to the other. if(beforeFirst && skrollable.edge === -1 || afterLast && skrollable.edge === 1) { continue; } //Add the skrollr-before or -after class. if(beforeFirst) { _updateClass(element, [SKROLLABLE_BEFORE_CLASS], [SKROLLABLE_AFTER_CLASS, SKROLLABLE_BETWEEN_CLASS]); //This handles the special case where we exit the first keyframe. if(emitEvents && lastFrameIndex > -1) { _emitEvent(element, firstFrame.eventType, _direction); skrollable.lastFrameIndex = -1; } } else { _updateClass(element, [SKROLLABLE_AFTER_CLASS], [SKROLLABLE_BEFORE_CLASS, SKROLLABLE_BETWEEN_CLASS]); //This handles the special case where we exit the last keyframe. if(emitEvents && lastFrameIndex < framesLength) { _emitEvent(element, lastFrame.eventType, _direction); skrollable.lastFrameIndex = framesLength; } } //Remember that we handled the edge case (before/after the first/last keyframe). skrollable.edge = beforeFirst ? -1 : 1; switch(skrollable.edgeStrategy) { case 'reset': _reset(element); continue; case 'ease': //Handle this case like it would be exactly at first/last keyframe and just pass it on. frame = firstOrLastFrame.frame; break; default: case 'set': var props = firstOrLastFrame.props; for(key in props) { if(hasProp.call(props, key)) { value = _interpolateString(props[key].value); //Set style or attribute. if(key.indexOf('@') === 0) { element.setAttribute(key.substr(1), value); } else { skrollr.setStyle(element, key, value); } } } continue; } } else { //Did we handle an edge last time? if(skrollable.edge !== 0) { _updateClass(element, [SKROLLABLE_CLASS, SKROLLABLE_BETWEEN_CLASS], [SKROLLABLE_BEFORE_CLASS, SKROLLABLE_AFTER_CLASS]); skrollable.edge = 0; } } //Find out between which two key frames we are right now. var keyFrameIndex = 0; for(; keyFrameIndex < framesLength - 1; keyFrameIndex++) { if(frame >= frames[keyFrameIndex].frame && frame <= frames[keyFrameIndex + 1].frame) { var left = frames[keyFrameIndex]; var right = frames[keyFrameIndex + 1]; for(key in left.props) { if(hasProp.call(left.props, key)) { var progress = (frame - left.frame) / (right.frame - left.frame); //Transform the current progress using the given easing function. progress = left.props[key].easing(progress); //Interpolate between the two values value = _calcInterpolation(left.props[key].value, right.props[key].value, progress); value = _interpolateString(value); //Set style or attribute. if(key.indexOf('@') === 0) { element.setAttribute(key.substr(1), value); } else { skrollr.setStyle(element, key, value); } } } //Are events enabled on this element? //This code handles the usual cases of scrolling through different keyframes. //The special cases of before first and after last keyframe are handled above. if(emitEvents) { //Did we pass a new keyframe? if(lastFrameIndex !== keyFrameIndex) { if(_direction === 'down') { _emitEvent(element, left.eventType, _direction); } else { _emitEvent(element, right.eventType, _direction); } skrollable.lastFrameIndex = keyFrameIndex; } } break; } } } }; /** * Renders all elements. */ var _render = function() { if(_requestReflow) { _requestReflow = false; _reflow(); } //We may render something else than the actual scrollbar position. var renderTop = _instance.getScrollTop(); //If there's an animation, which ends in current render call, call the callback after rendering. var afterAnimationCallback; var now = _now(); var progress; //Before actually rendering handle the scroll animation, if any. if(_scrollAnimation) { //It's over if(now >= _scrollAnimation.endTime) { renderTop = _scrollAnimation.targetTop; afterAnimationCallback = _scrollAnimation.done; _scrollAnimation = undefined; } else { //Map the current progress to the new progress using given easing function. progress = _scrollAnimation.easing((now - _scrollAnimation.startTime) / _scrollAnimation.duration); renderTop = (_scrollAnimation.startTop + progress * _scrollAnimation.topDiff) | 0; } _instance.setScrollTop(renderTop, true); } //Smooth scrolling only if there's no animation running and if we're not forcing the rendering. else if(!_forceRender) { var smoothScrollingDiff = _smoothScrolling.targetTop - renderTop; //The user scrolled, start new smooth scrolling. if(smoothScrollingDiff) { _smoothScrolling = { startTop: _lastTop, topDiff: renderTop - _lastTop, targetTop: renderTop, startTime: _lastRenderCall, endTime: _lastRenderCall + _smoothScrollingDuration }; } //Interpolate the internal scroll position (not the actual scrollbar). if(now <= _smoothScrolling.endTime) { //Map the current progress to the new progress using easing function. progress = easings.sqrt((now - _smoothScrolling.startTime) / _smoothScrollingDuration); renderTop = (_smoothScrolling.startTop + progress * _smoothScrolling.topDiff) | 0; } } //Did the scroll position even change? if(_forceRender || _lastTop !== renderTop) { //Remember in which direction are we scrolling? _direction = (renderTop > _lastTop) ? 'down' : (renderTop < _lastTop ? 'up' : _direction); _forceRender = false; var listenerParams = { curTop: renderTop, lastTop: _lastTop, maxTop: _maxKeyFrame, direction: _direction }; //Tell the listener we are about to render. var continueRendering = _listeners.beforerender && _listeners.beforerender.call(_instance, listenerParams); //The beforerender listener function is able the cancel rendering. if(continueRendering !== false) { //Now actually interpolate all the styles. _calcSteps(renderTop, _instance.getScrollTop()); //That's were we actually "scroll" on mobile. if(_isMobile && _skrollrBody) { //Set the transform ("scroll it"). skrollr.setStyle(_skrollrBody, 'transform', 'translate(0, ' + -(_mobileOffset) + 'px) ' + _translateZ); } //Remember when we last rendered. _lastTop = renderTop; if(_listeners.render) { _listeners.render.call(_instance, listenerParams); } } if(afterAnimationCallback) { afterAnimationCallback.call(_instance, false); } } _lastRenderCall = now; }; /** * Parses the properties for each key frame of the given skrollable. */ var _parseProps = function(skrollable) { //Iterate over all key frames var keyFrameIndex = 0; var keyFramesLength = skrollable.keyFrames.length; for(; keyFrameIndex < keyFramesLength; keyFrameIndex++) { var frame = skrollable.keyFrames[keyFrameIndex]; var easing; var value; var prop; var props = {}; var match; while((match = rxPropValue.exec(frame.props)) !== null) { prop = match[1]; value = match[2]; easing = prop.match(rxPropEasing); //Is there an easing specified for this prop? if(easing !== null) { prop = easing[1]; easing = easing[2]; } else { easing = DEFAULT_EASING; } //Exclamation point at first position forces the value to be taken literal. value = value.indexOf('!') ? _parseProp(value) : [value.slice(1)]; //Save the prop for this key frame with his value and easing function props[prop] = { value: value, easing: easings[easing] }; } frame.props = props; } }; /** * Parses a value extracting numeric values and generating a format string * for later interpolation of the new values in old string. * * @param val The CSS value to be parsed. * @return Something like ["rgba(?%,?%, ?%,?)", 100, 50, 0, .7] * where the first element is the format string later used * and all following elements are the numeric value. */ var _parseProp = function(val) { var numbers = []; //One special case, where floats don't work. //We replace all occurences of rgba colors //which don't use percentage notation with the percentage notation. rxRGBAIntegerColor.lastIndex = 0; val = val.replace(rxRGBAIntegerColor, function(rgba) { return rgba.replace(rxNumericValue, function(n) { return n / 255 * 100 + '%'; }); }); //Handle prefixing of "gradient" values. //For now only the prefixed value will be set. Unprefixed isn't supported anyway. if(theDashedCSSPrefix) { rxGradient.lastIndex = 0; val = val.replace(rxGradient, function(s) { return theDashedCSSPrefix + s; }); } //Now parse ANY number inside this string and create a format string. val = val.replace(rxNumericValue, function(n) { numbers.push(+n); return '{?}'; }); //Add the formatstring as first value. numbers.unshift(val); return numbers; }; /** * Fills the key frames with missing left and right hand properties. * If key frame 1 has property X and key frame 2 is missing X, * but key frame 3 has X again, then we need to assign X to key frame 2 too. * * @param sk A skrollable. */ var _fillProps = function(sk) { //Will collect the properties key frame by key frame var propList = {}; var keyFrameIndex; var keyFramesLength; //Iterate over all key frames from left to right keyFrameIndex = 0; keyFramesLength = sk.keyFrames.length; for(; keyFrameIndex < keyFramesLength; keyFrameIndex++) { _fillPropForFrame(sk.keyFrames[keyFrameIndex], propList); } //Now do the same from right to fill the last gaps propList = {}; //Iterate over all key frames from right to left keyFrameIndex = sk.keyFrames.length - 1; for(; keyFrameIndex >= 0; keyFrameIndex--) { _fillPropForFrame(sk.keyFrames[keyFrameIndex], propList); } }; var _fillPropForFrame = function(frame, propList) { var key; //For each key frame iterate over all right hand properties and assign them, //but only if the current key frame doesn't have the property by itself for(key in propList) { //The current frame misses this property, so assign it. if(!hasProp.call(frame.props, key)) { frame.props[key] = propList[key]; } } //Iterate over all props of the current frame and collect them for(key in frame.props) { propList[key] = frame.props[key]; } }; /** * Calculates the new values for two given values array. */ var _calcInterpolation = function(val1, val2, progress) { var valueIndex; var val1Length = val1.length; //They both need to have the same length if(val1Length !== val2.length) { throw 'Can\'t interpolate between "' + val1[0] + '" and "' + val2[0] + '"'; } //Add the format string as first element. var interpolated = [val1[0]]; valueIndex = 1; for(; valueIndex < val1Length; valueIndex++) { //That's the line where the two numbers are actually interpolated. interpolated[valueIndex] = val1[valueIndex] + ((val2[valueIndex] - val1[valueIndex]) * progress); } return interpolated; }; /** * Interpolates the numeric values into the format string. */ var _interpolateString = function(val) { var valueIndex = 1; rxInterpolateString.lastIndex = 0; return val[0].replace(rxInterpolateString, function() { return val[valueIndex++]; }); }; /** * Resets the class and style attribute to what it was before skrollr manipulated the element. * Also remembers the values it had before reseting, in order to undo the reset. */ var _reset = function(elements, undo) { //We accept a single element or an array of elements. elements = [].concat(elements); var skrollable; var element; var elementsIndex = 0; var elementsLength = elements.length; for(; elementsIndex < elementsLength; elementsIndex++) { element = elements[elementsIndex]; skrollable = _skrollables[element[SKROLLABLE_ID_DOM_PROPERTY]]; //Couldn't find the skrollable for this DOM element. if(!skrollable) { continue; } if(undo) { //Reset class and style to the "dirty" (set by skrollr) values. element.style.cssText = skrollable.dirtyStyleAttr; _updateClass(element, skrollable.dirtyClassAttr); } else { //Remember the "dirty" (set by skrollr) class and style. skrollable.dirtyStyleAttr = element.style.cssText; skrollable.dirtyClassAttr = _getClass(element); //Reset class and style to what it originally was. element.style.cssText = skrollable.styleAttr; _updateClass(element, skrollable.classAttr); } } }; /** * Detects support for 3d transforms by applying it to the skrollr-body. */ var _detect3DTransforms = function() { _translateZ = 'translateZ(0)'; skrollr.setStyle(_skrollrBody, 'transform', _translateZ); var computedStyle = getStyle(_skrollrBody); var computedTransform = computedStyle.getPropertyValue('transform'); var computedTransformWithPrefix = computedStyle.getPropertyValue(theDashedCSSPrefix + 'transform'); var has3D = (computedTransform && computedTransform !== 'none') || (computedTransformWithPrefix && computedTransformWithPrefix !== 'none'); if(!has3D) { _translateZ = ''; } }; /** * Set the CSS property on the given element. Sets prefixed properties as well. */ skrollr.setStyle = function(el, prop, val) { var style = el.style; //Camel case. prop = prop.replace(rxCamelCase, rxCamelCaseFn).replace('-', ''); //Make sure z-index gets a . //This is the only case we need to handle. if(prop === 'zIndex') { if(isNaN(val)) { //If it's not a number, don't touch it. //It could for example be "auto" (#351). style[prop] = val; } else { //Floor the number. style[prop] = '' + (val | 0); } } //#64: "float" can't be set across browsers. Needs to use "cssFloat" for all except IE. else if(prop === 'float') { style.styleFloat = style.cssFloat = val; } else { //Need try-catch for old IE. try { //Set prefixed property if there's a prefix. if(theCSSPrefix) { style[theCSSPrefix + prop.slice(0,1).toUpperCase() + prop.slice(1)] = val; } //Set unprefixed. style[prop] = val; } catch(ignore) {} } }; /** * Cross browser event handling. */ var _addEvent = skrollr.addEvent = function(element, names, callback) { var intermediate = function(e) { //Normalize IE event stuff. e = e || window.event; if(!e.target) { e.target = e.srcElement; } if(!e.preventDefault) { e.preventDefault = function() { e.returnValue = false; e.defaultPrevented = true; }; } return callback.call(this, e); }; names = names.split(' '); var name; var nameCounter = 0; var namesLength = names.length; for(; nameCounter < namesLength; nameCounter++) { name = names[nameCounter]; if(element.addEventListener) { element.addEventListener(name, callback, false); } else { element.attachEvent('on' + name, intermediate); } //Remember the events to be able to flush them later. _registeredEvents.push({ element: element, name: name, listener: callback }); } }; var _removeEvent = skrollr.removeEvent = function(element, names, callback) { names = names.split(' '); var nameCounter = 0; var namesLength = names.length; for(; nameCounter < namesLength; nameCounter++) { if(element.removeEventListener) { element.removeEventListener(names[nameCounter], callback, false); } else { element.detachEvent('on' + names[nameCounter], callback); } } }; var _removeAllEvents = function() { var eventData; var eventCounter = 0; var eventsLength = _registeredEvents.length; for(; eventCounter < eventsLength; eventCounter++) { eventData = _registeredEvents[eventCounter]; _removeEvent(eventData.element, eventData.name, eventData.listener); } _registeredEvents = []; }; var _emitEvent = function(element, name, direction) { if(_listeners.keyframe) { _listeners.keyframe.call(_instance, element, name, direction); } }; var _reflow = function() { var pos = _instance.getScrollTop(); //Will be recalculated by _updateDependentKeyFrames. _maxKeyFrame = 0; if(_forceHeight && !_isMobile) { //un-"force" the height to not mess with the calculations in _updateDependentKeyFrames (#216). body.style.height = ''; } _updateDependentKeyFrames(); if(_forceHeight && !_isMobile) { //"force" the height. body.style.height = (_maxKeyFrame + documentElement.clientHeight) + 'px'; } //The scroll offset may now be larger than needed (on desktop the browser/os prevents scrolling farther than the bottom). if(_isMobile) { _instance.setScrollTop(Math.min(_instance.getScrollTop(), _maxKeyFrame)); } else { //Remember and reset the scroll pos (#217). _instance.setScrollTop(pos, true); } _forceRender = true; }; /* * Returns a copy of the constants object where all functions and strings have been evaluated. */ var _processConstants = function() { var viewportHeight = documentElement.clientHeight; var copy = {}; var prop; var value; for(prop in _constants) { value = _constants[prop]; if(typeof value === 'function') { value = value.call(_instance); } //Percentage offset. else if((/p$/).test(value)) { value = (value.slice(0, -1) / 100) * viewportHeight; } copy[prop] = value; } return copy; }; /* * Returns the height of the document. */ var _getDocumentHeight = function() { var skrollrBodyHeight = 0; var bodyHeight; if(_skrollrBody) { skrollrBodyHeight = Math.max(_skrollrBody.offsetHeight, _skrollrBody.scrollHeight); } bodyHeight = Math.max(skrollrBodyHeight, body.scrollHeight, body.offsetHeight, documentElement.scrollHeight, documentElement.offsetHeight, documentElement.clientHeight); return bodyHeight - documentElement.clientHeight; }; /** * Returns a string of space separated classnames for the current element. * Works with SVG as well. */ var _getClass = function(element) { var prop = 'className'; //SVG support by using className.baseVal instead of just className. if(window.SVGElement && element instanceof window.SVGElement) { element = element[prop]; prop = 'baseVal'; } return element[prop]; }; /** * Adds and removes a CSS classes. * Works with SVG as well. * add and remove are arrays of strings, * or if remove is ommited add is a string and overwrites all classes. */ var _updateClass = function(element, add, remove) { var prop = 'className'; //SVG support by using className.baseVal instead of just className. if(window.SVGElement && element instanceof window.SVGElement) { element = element[prop]; prop = 'baseVal'; } //When remove is ommited, we want to overwrite/set the classes. if(remove === undefined) { element[prop] = add; return; } //Cache current classes. We will work on a string before passing back to DOM. var val = element[prop]; //All classes to be removed. var classRemoveIndex = 0; var removeLength = remove.length; for(; classRemoveIndex < removeLength; classRemoveIndex++) { val = _untrim(val).replace(_untrim(remove[classRemoveIndex]), ' '); } val = _trim(val); //All classes to be added. var classAddIndex = 0; var addLength = add.length; for(; classAddIndex < addLength; classAddIndex++) { //Only add if el not already has class. if(_untrim(val).indexOf(_untrim(add[classAddIndex])) === -1) { val += ' ' + add[classAddIndex]; } } element[prop] = _trim(val); }; var _trim = function(a) { return a.replace(rxTrim, ''); }; /** * Adds a space before and after the string. */ var _untrim = function(a) { return ' ' + a + ' '; }; var _now = Date.now || function() { return +new Date(); }; var _keyFrameComparator = function(a, b) { return a.frame - b.frame; }; /* * Private variables. */ //Singleton var _instance; /* A list of all elements which should be animated associated with their the metadata. Exmaple skrollable with two key frames animating from 100px width to 20px: skrollable = { element: , styleAttr:
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
================================================ FILE: test/jquery.js ================================================ /*! jQuery v1.7.2 jquery.com | jquery.org/license */ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); ================================================ FILE: test/loading-tests.js ================================================ /* * Test to see if skrollr is loaded properly * - module support with require * - global variable exposure without module */ /*global $:false, require:false, start:false, ok:false, QUnit:false, asyncTest:false */ $(function(){ 'use strict'; // a helper to load a script specified by the path argument // onLoaded is called once the script is loaded function loadScript(path, onLoaded){ $.getScript( path, function() { if(typeof onLoaded === 'function'){ onLoaded.call(); } }); } // remove skrollr from the global scope after each test is run QUnit.testDone(function() { if(typeof window.skrollr !== 'undefined'){ delete window.skrollr; } }); //tests asyncTest('skrollr is available through global scope without require', function(){ ok(typeof skrollr === 'undefined', 'skrollr is not available before the script is loaded'); loadScript('../src/skrollr.js', function() { ok(typeof skrollr !== 'undefined', 'skrollr is available through global scope'); start(); }); }); asyncTest('skrollr is available as a module when require.js is present', function(){ ok(typeof skrollr === 'undefined', 'skrollr is not available before the script is loaded'); loadScript('require.js', function(){ require.config({ baseUrl: '../src', waitSeconds: 15 }); require(['skrollr'], function(skrollr){ ok(typeof skrollr !== 'undefined', 'skrollr is available as a module'); start(); }); }); }); }); ================================================ FILE: test/loading.html ================================================ skrollr test suite
================================================ FILE: test/qunit-numeric-css-property-equals.js ================================================ QUnit.extend(QUnit, { rxNumericCSSProperty: /[0-9.]+/g, numericCSSPropertyEquals: function(actual, expected, message) { //Simple case, both strings already match. if(actual === expected) { QUnit.push(true, actual, expected, message); return; } //Now extract all numbers from the property string. //e.g. "0.5px 100px" will result in ["0.5", "100"] var actualArray = actual.match(QUnit.rxNumericCSSProperty); var expectedArray = expected.match(QUnit.rxNumericCSSProperty); var passes = actualArray !== null && expectedArray !== null && actualArray.length === expectedArray.length; for(var i = 0; passes && i < actualArray.length; i++) { var curActual = actualArray[i]; var curExpected = expectedArray[i]; var delta = 0.01; //Use 0.01 for floats and 1 for ints. if(curActual.indexOf('.') === -1 && curExpected.indexOf('.') === -1) { delta = 1; } curActual = parseFloat(curActual); curExpected = parseFloat(curExpected); passes = (curActual === curExpected) || Math.abs(curActual - curExpected) <= delta; } QUnit.push(passes, actual, expected, message); } }); ================================================ FILE: test/qunit.css ================================================ /** * QUnit v1.5.0 - A JavaScript Unit Testing Framework * * http://docs.jquery.com/QUnit * * Copyright (c) 2012 John Resig, Jörn Zaefferer * Dual licensed under the MIT (MIT-LICENSE.txt) * or GPL (GPL-LICENSE.txt) licenses. */ /** Font Family and Sizes */ #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; } #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } #qunit-tests { font-size: smaller; } /** Resets */ #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { margin: 0; padding: 0; } /** Header */ #qunit-header { padding: 0.5em 0 0.5em 1em; color: #8699a4; background-color: #0d3349; font-size: 1.5em; line-height: 1em; font-weight: normal; border-radius: 15px 15px 0 0; -moz-border-radius: 15px 15px 0 0; -webkit-border-top-right-radius: 15px; -webkit-border-top-left-radius: 15px; } #qunit-header a { text-decoration: none; color: #c2ccd1; } #qunit-header a:hover, #qunit-header a:focus { color: #fff; } #qunit-header label { display: inline-block; } #qunit-banner { height: 5px; } #qunit-testrunner-toolbar { padding: 0.5em 0 0.5em 2em; color: #5E740B; background-color: #eee; } #qunit-userAgent { padding: 0.5em 0 0.5em 2.5em; background-color: #2b81af; color: #fff; text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; } /** Tests: Pass/Fail */ #qunit-tests { list-style-position: inside; } #qunit-tests li { padding: 0.4em 0.5em 0.4em 2.5em; border-bottom: 1px solid #fff; list-style-position: inside; } #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { display: none; } #qunit-tests li strong { cursor: pointer; } #qunit-tests li a { padding: 0.5em; color: #c2ccd1; text-decoration: none; } #qunit-tests li a:hover, #qunit-tests li a:focus { color: #000; } #qunit-tests ol { margin-top: 0.5em; padding: 0.5em; background-color: #fff; border-radius: 15px; -moz-border-radius: 15px; -webkit-border-radius: 15px; box-shadow: inset 0px 2px 13px #999; -moz-box-shadow: inset 0px 2px 13px #999; -webkit-box-shadow: inset 0px 2px 13px #999; } #qunit-tests table { border-collapse: collapse; margin-top: .2em; } #qunit-tests th { text-align: right; vertical-align: top; padding: 0 .5em 0 0; } #qunit-tests td { vertical-align: top; } #qunit-tests pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; } #qunit-tests del { background-color: #e0f2be; color: #374e0c; text-decoration: none; } #qunit-tests ins { background-color: #ffcaca; color: #500; text-decoration: none; } /*** Test Counts */ #qunit-tests b.counts { color: black; } #qunit-tests b.passed { color: #5E740B; } #qunit-tests b.failed { color: #710909; } #qunit-tests li li { margin: 0.5em; padding: 0.4em 0.5em 0.4em 0.5em; background-color: #fff; border-bottom: none; list-style-position: inside; } /*** Passing Styles */ #qunit-tests li li.pass { color: #5E740B; background-color: #fff; border-left: 26px solid #C6E746; } #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } #qunit-tests .pass .test-name { color: #366097; } #qunit-tests .pass .test-actual, #qunit-tests .pass .test-expected { color: #999999; } #qunit-banner.qunit-pass { background-color: #C6E746; } /*** Failing Styles */ #qunit-tests li li.fail { color: #710909; background-color: #fff; border-left: 26px solid #EE5757; white-space: pre; } #qunit-tests > li:last-child { border-radius: 0 0 15px 15px; -moz-border-radius: 0 0 15px 15px; -webkit-border-bottom-right-radius: 15px; -webkit-border-bottom-left-radius: 15px; } #qunit-tests .fail { color: #000000; background-color: #EE5757; } #qunit-tests .fail .test-name, #qunit-tests .fail .module-name { color: #000000; } #qunit-tests .fail .test-actual { color: #EE5757; } #qunit-tests .fail .test-expected { color: green; } #qunit-banner.qunit-fail { background-color: #EE5757; } /** Result */ #qunit-testresult { padding: 0.5em 0.5em 0.5em 2.5em; color: #2b81af; background-color: #D2E0E6; border-bottom: 1px solid white; } #qunit-testresult .module-name { font-weight: bold; } /** Fixture */ #qunit-fixture { position: absolute; top: -10000px; left: -10000px; width: 1000px; height: 1000px; } ================================================ FILE: test/qunit.js ================================================ /** * QUnit v1.5.0 - A JavaScript Unit Testing Framework * * http://docs.jquery.com/QUnit * * Copyright (c) 2012 John Resig, Jörn Zaefferer * Dual licensed under the MIT (MIT-LICENSE.txt) * or GPL (GPL-LICENSE.txt) licenses. */ (function(window) { var defined = { setTimeout: typeof window.setTimeout !== "undefined", sessionStorage: (function() { var x = "qunit-test-string"; try { sessionStorage.setItem(x, x); sessionStorage.removeItem(x); return true; } catch(e) { return false; } }()) }; var testId = 0, toString = Object.prototype.toString, hasOwn = Object.prototype.hasOwnProperty; var Test = function(name, testName, expected, async, callback) { this.name = name; this.testName = testName; this.expected = expected; this.async = async; this.callback = callback; this.assertions = []; }; Test.prototype = { init: function() { var tests = id("qunit-tests"); if (tests) { var b = document.createElement("strong"); b.innerHTML = "Running " + this.name; var li = document.createElement("li"); li.appendChild( b ); li.className = "running"; li.id = this.id = "test-output" + testId++; tests.appendChild( li ); } }, setup: function() { if (this.module != config.previousModule) { if ( config.previousModule ) { runLoggingCallbacks('moduleDone', QUnit, { name: config.previousModule, failed: config.moduleStats.bad, passed: config.moduleStats.all - config.moduleStats.bad, total: config.moduleStats.all } ); } config.previousModule = this.module; config.moduleStats = { all: 0, bad: 0 }; runLoggingCallbacks( 'moduleStart', QUnit, { name: this.module } ); } else if (config.autorun) { runLoggingCallbacks( 'moduleStart', QUnit, { name: this.module } ); } config.current = this; this.testEnvironment = extend({ setup: function() {}, teardown: function() {} }, this.moduleTestEnvironment); runLoggingCallbacks( 'testStart', QUnit, { name: this.testName, module: this.module }); // allow utility functions to access the current test environment // TODO why?? QUnit.current_testEnvironment = this.testEnvironment; if ( !config.pollution ) { saveGlobal(); } if ( config.notrycatch ) { this.testEnvironment.setup.call(this.testEnvironment); return; } try { this.testEnvironment.setup.call(this.testEnvironment); } catch(e) { QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); } }, run: function() { config.current = this; var running = id("qunit-testresult"); if ( running ) { running.innerHTML = "Running:
" + this.name; } if ( this.async ) { QUnit.stop(); } if ( config.notrycatch ) { this.callback.call(this.testEnvironment); return; } try { this.callback.call(this.testEnvironment); } catch(e) { QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + ": " + e.message, extractStacktrace( e, 1 ) ); // else next test will carry the responsibility saveGlobal(); // Restart the tests if they're blocking if ( config.blocking ) { QUnit.start(); } } }, teardown: function() { config.current = this; if ( config.notrycatch ) { this.testEnvironment.teardown.call(this.testEnvironment); return; } else { try { this.testEnvironment.teardown.call(this.testEnvironment); } catch(e) { QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); } } checkPollution(); }, finish: function() { config.current = this; if ( this.expected != null && this.expected != this.assertions.length ) { QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" ); } else if ( this.expected == null && !this.assertions.length ) { QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions." ); } var good = 0, bad = 0, li, i, tests = id("qunit-tests"); config.stats.all += this.assertions.length; config.moduleStats.all += this.assertions.length; if ( tests ) { var ol = document.createElement("ol"); for ( i = 0; i < this.assertions.length; i++ ) { var assertion = this.assertions[i]; li = document.createElement("li"); li.className = assertion.result ? "pass" : "fail"; li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed"); ol.appendChild( li ); if ( assertion.result ) { good++; } else { bad++; config.stats.bad++; config.moduleStats.bad++; } } // store result when possible if ( QUnit.config.reorder && defined.sessionStorage ) { if (bad) { sessionStorage.setItem("qunit-test-" + this.module + "-" + this.testName, bad); } else { sessionStorage.removeItem("qunit-test-" + this.module + "-" + this.testName); } } if (bad === 0) { ol.style.display = "none"; } var b = document.createElement("strong"); b.innerHTML = this.name + " (" + bad + ", " + good + ", " + this.assertions.length + ")"; var a = document.createElement("a"); a.innerHTML = "Rerun"; a.href = QUnit.url({ filter: getText([b]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") }); addEvent(b, "click", function() { var next = b.nextSibling.nextSibling, display = next.style.display; next.style.display = display === "none" ? "block" : "none"; }); addEvent(b, "dblclick", function(e) { var target = e && e.target ? e.target : window.event.srcElement; if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) { target = target.parentNode; } if ( window.location && target.nodeName.toLowerCase() === "strong" ) { window.location = QUnit.url({ filter: getText([target]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") }); } }); li = id(this.id); li.className = bad ? "fail" : "pass"; li.removeChild( li.firstChild ); li.appendChild( b ); li.appendChild( a ); li.appendChild( ol ); } else { for ( i = 0; i < this.assertions.length; i++ ) { if ( !this.assertions[i].result ) { bad++; config.stats.bad++; config.moduleStats.bad++; } } } QUnit.reset(); runLoggingCallbacks( 'testDone', QUnit, { name: this.testName, module: this.module, failed: bad, passed: this.assertions.length - bad, total: this.assertions.length } ); }, queue: function() { var test = this; synchronize(function() { test.init(); }); function run() { // each of these can by async synchronize(function() { test.setup(); }); synchronize(function() { test.run(); }); synchronize(function() { test.teardown(); }); synchronize(function() { test.finish(); }); } // defer when previous test run passed, if storage is available var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-test-" + this.module + "-" + this.testName); if (bad) { run(); } else { synchronize(run, true); } } }; var QUnit = { // call on start of module test to prepend name to all tests module: function(name, testEnvironment) { config.currentModule = name; config.currentModuleTestEnviroment = testEnvironment; }, asyncTest: function(testName, expected, callback) { if ( arguments.length === 2 ) { callback = expected; expected = null; } QUnit.test(testName, expected, callback, true); }, test: function(testName, expected, callback, async) { var name = '' + escapeInnerText(testName) + ''; if ( arguments.length === 2 ) { callback = expected; expected = null; } if ( config.currentModule ) { name = '' + config.currentModule + ": " + name; } if ( !validTest(config.currentModule + ": " + testName) ) { return; } var test = new Test(name, testName, expected, async, callback); test.module = config.currentModule; test.moduleTestEnvironment = config.currentModuleTestEnviroment; test.queue(); }, // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. expect: function(asserts) { config.current.expected = asserts; }, // Asserts true. // @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); ok: function(result, msg) { if (!config.current) { throw new Error("ok() assertion outside test context, was " + sourceFromStacktrace(2)); } result = !!result; var details = { result: result, message: msg }; msg = escapeInnerText(msg || (result ? "okay" : "failed")); if ( !result ) { var source = sourceFromStacktrace(2); if (source) { details.source = source; msg += '
Source:
' + escapeInnerText(source) + '
'; } } runLoggingCallbacks( 'log', QUnit, details ); config.current.assertions.push({ result: result, message: msg }); }, // Checks that the first two arguments are equal, with an optional message. Prints out both actual and expected values. // @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." ); equal: function(actual, expected, message) { QUnit.push(expected == actual, actual, expected, message); }, notEqual: function(actual, expected, message) { QUnit.push(expected != actual, actual, expected, message); }, deepEqual: function(actual, expected, message) { QUnit.push(QUnit.equiv(actual, expected), actual, expected, message); }, notDeepEqual: function(actual, expected, message) { QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message); }, strictEqual: function(actual, expected, message) { QUnit.push(expected === actual, actual, expected, message); }, notStrictEqual: function(actual, expected, message) { QUnit.push(expected !== actual, actual, expected, message); }, raises: function(block, expected, message) { var actual, ok = false; if (typeof expected === 'string') { message = expected; expected = null; } try { block.call(config.current.testEnvironment); } catch (e) { actual = e; } if (actual) { // we don't want to validate thrown error if (!expected) { ok = true; // expected is a regexp } else if (QUnit.objectType(expected) === "regexp") { ok = expected.test(actual); // expected is a constructor } else if (actual instanceof expected) { ok = true; // expected is a validation function which returns true is validation passed } else if (expected.call({}, actual) === true) { ok = true; } } QUnit.ok(ok, message); }, start: function(count) { config.semaphore -= count || 1; if (config.semaphore > 0) { // don't start until equal number of stop-calls return; } if (config.semaphore < 0) { // ignore if start is called more often then stop config.semaphore = 0; } // A slight delay, to avoid any current callbacks if ( defined.setTimeout ) { window.setTimeout(function() { if (config.semaphore > 0) { return; } if ( config.timeout ) { clearTimeout(config.timeout); } config.blocking = false; process(true); }, 13); } else { config.blocking = false; process(true); } }, stop: function(count) { config.semaphore += count || 1; config.blocking = true; if ( config.testTimeout && defined.setTimeout ) { clearTimeout(config.timeout); config.timeout = window.setTimeout(function() { QUnit.ok( false, "Test timed out" ); config.semaphore = 1; QUnit.start(); }, config.testTimeout); } } }; //We want access to the constructor's prototype (function() { function F(){} F.prototype = QUnit; QUnit = new F(); //Make F QUnit's constructor so that we can add to the prototype later QUnit.constructor = F; }()); // deprecated; still export them to window to provide clear error messages // next step: remove entirely QUnit.equals = function() { QUnit.push(false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead"); }; QUnit.same = function() { QUnit.push(false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead"); }; // Maintain internal state var config = { // The queue of tests to run queue: [], // block until document ready blocking: true, // when enabled, show only failing tests // gets persisted through sessionStorage and can be changed in UI via checkbox hidepassed: false, // by default, run previously failed tests first // very useful in combination with "Hide passed tests" checked reorder: true, // by default, modify document.title when suite is done altertitle: true, urlConfig: ['noglobals', 'notrycatch'], //logging callback queues begin: [], done: [], log: [], testStart: [], testDone: [], moduleStart: [], moduleDone: [] }; // Load paramaters (function() { var location = window.location || { search: "", protocol: "file:" }, params = location.search.slice( 1 ).split( "&" ), length = params.length, urlParams = {}, current; if ( params[ 0 ] ) { for ( var i = 0; i < length; i++ ) { current = params[ i ].split( "=" ); current[ 0 ] = decodeURIComponent( current[ 0 ] ); // allow just a key to turn on a flag, e.g., test.html?noglobals current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; urlParams[ current[ 0 ] ] = current[ 1 ]; } } QUnit.urlParams = urlParams; config.filter = urlParams.filter; // Figure out if we're running the tests from a server or not QUnit.isLocal = location.protocol === 'file:'; }()); // Expose the API as global variables, unless an 'exports' // object exists, in that case we assume we're in CommonJS - export everything at the end if ( typeof exports === "undefined" || typeof require === "undefined" ) { extend(window, QUnit); window.QUnit = QUnit; } // define these after exposing globals to keep them in these QUnit namespace only extend(QUnit, { config: config, // Initialize the configuration options init: function() { extend(config, { stats: { all: 0, bad: 0 }, moduleStats: { all: 0, bad: 0 }, started: +new Date(), updateRate: 1000, blocking: false, autostart: true, autorun: false, filter: "", queue: [], semaphore: 0 }); var qunit = id( "qunit" ); if ( qunit ) { qunit.innerHTML = '

' + escapeInnerText( document.title ) + '

' + '

' + '
' + '

' + '
    '; } var tests = id( "qunit-tests" ), banner = id( "qunit-banner" ), result = id( "qunit-testresult" ); if ( tests ) { tests.innerHTML = ""; } if ( banner ) { banner.className = ""; } if ( result ) { result.parentNode.removeChild( result ); } if ( tests ) { result = document.createElement( "p" ); result.id = "qunit-testresult"; result.className = "result"; tests.parentNode.insertBefore( result, tests ); result.innerHTML = 'Running...
     '; } }, // Resets the test setup. Useful for tests that modify the DOM. // If jQuery is available, uses jQuery's html(), otherwise just innerHTML. reset: function() { if ( window.jQuery ) { jQuery( "#qunit-fixture" ).html( config.fixture ); } else { var main = id( 'qunit-fixture' ); if ( main ) { main.innerHTML = config.fixture; } } }, // Trigger an event on an element. // @example triggerEvent( document.body, "click" ); triggerEvent: function( elem, type, event ) { if ( document.createEvent ) { event = document.createEvent("MouseEvents"); event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null); elem.dispatchEvent( event ); } else if ( elem.fireEvent ) { elem.fireEvent("on"+type); } }, // Safe object type checking is: function( type, obj ) { return QUnit.objectType( obj ) == type; }, objectType: function( obj ) { if (typeof obj === "undefined") { return "undefined"; // consider: typeof null === object } if (obj === null) { return "null"; } var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || ''; switch (type) { case 'Number': if (isNaN(obj)) { return "nan"; } return "number"; case 'String': case 'Boolean': case 'Array': case 'Date': case 'RegExp': case 'Function': return type.toLowerCase(); } if (typeof obj === "object") { return "object"; } return undefined; }, push: function(result, actual, expected, message) { if (!config.current) { throw new Error("assertion outside test context, was " + sourceFromStacktrace()); } var details = { result: result, message: message, actual: actual, expected: expected }; message = escapeInnerText(message) || (result ? "okay" : "failed"); message = '' + message + ""; var output = message; if (!result) { expected = escapeInnerText(QUnit.jsDump.parse(expected)); actual = escapeInnerText(QUnit.jsDump.parse(actual)); output += ''; if (actual != expected) { output += ''; output += ''; } var source = sourceFromStacktrace(); if (source) { details.source = source; output += ''; } output += "
    Expected:
    ' + expected + '
    Result:
    ' + actual + '
    Diff:
    ' + QUnit.diff(expected, actual) +'
    Source:
    ' + escapeInnerText(source) + '
    "; } runLoggingCallbacks( 'log', QUnit, details ); config.current.assertions.push({ result: !!result, message: output }); }, pushFailure: function(message, source) { var details = { result: false, message: message }; var output = escapeInnerText(message); if (source) { details.source = source; output += '
    Source:
    ' + escapeInnerText(source) + '
    '; } runLoggingCallbacks( 'log', QUnit, details ); config.current.assertions.push({ result: false, message: output }); }, url: function( params ) { params = extend( extend( {}, QUnit.urlParams ), params ); var querystring = "?", key; for ( key in params ) { if ( !hasOwn.call( params, key ) ) { continue; } querystring += encodeURIComponent( key ) + "=" + encodeURIComponent( params[ key ] ) + "&"; } return window.location.pathname + querystring.slice( 0, -1 ); }, extend: extend, id: id, addEvent: addEvent }); //QUnit.constructor is set to the empty F() above so that we can add to it's prototype later //Doing this allows us to tell if the following methods have been overwritten on the actual //QUnit object, which is a deprecated way of using the callbacks. extend(QUnit.constructor.prototype, { // Logging callbacks; all receive a single argument with the listed properties // run test/logs.html for any related changes begin: registerLoggingCallback('begin'), // done: { failed, passed, total, runtime } done: registerLoggingCallback('done'), // log: { result, actual, expected, message } log: registerLoggingCallback('log'), // testStart: { name } testStart: registerLoggingCallback('testStart'), // testDone: { name, failed, passed, total } testDone: registerLoggingCallback('testDone'), // moduleStart: { name } moduleStart: registerLoggingCallback('moduleStart'), // moduleDone: { name, failed, passed, total } moduleDone: registerLoggingCallback('moduleDone') }); if ( typeof document === "undefined" || document.readyState === "complete" ) { config.autorun = true; } QUnit.load = function() { runLoggingCallbacks( 'begin', QUnit, {} ); // Initialize the config, saving the execution queue var oldconfig = extend({}, config); QUnit.init(); extend(config, oldconfig); config.blocking = false; var urlConfigHtml = '', len = config.urlConfig.length; for ( var i = 0, val; i < len; i++ ) { val = config.urlConfig[i]; config[val] = QUnit.urlParams[val]; urlConfigHtml += ''; } var userAgent = id("qunit-userAgent"); if ( userAgent ) { userAgent.innerHTML = navigator.userAgent; } var banner = id("qunit-header"); if ( banner ) { banner.innerHTML = ' ' + banner.innerHTML + ' ' + urlConfigHtml; addEvent( banner, "change", function( event ) { var params = {}; params[ event.target.name ] = event.target.checked ? true : undefined; window.location = QUnit.url( params ); }); } var toolbar = id("qunit-testrunner-toolbar"); if ( toolbar ) { var filter = document.createElement("input"); filter.type = "checkbox"; filter.id = "qunit-filter-pass"; addEvent( filter, "click", function() { var ol = document.getElementById("qunit-tests"); if ( filter.checked ) { ol.className = ol.className + " hidepass"; } else { var tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; ol.className = tmp.replace(/ hidepass /, " "); } if ( defined.sessionStorage ) { if (filter.checked) { sessionStorage.setItem("qunit-filter-passed-tests", "true"); } else { sessionStorage.removeItem("qunit-filter-passed-tests"); } } }); if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) { filter.checked = true; var ol = document.getElementById("qunit-tests"); ol.className = ol.className + " hidepass"; } toolbar.appendChild( filter ); var label = document.createElement("label"); label.setAttribute("for", "qunit-filter-pass"); label.innerHTML = "Hide passed tests"; toolbar.appendChild( label ); } var main = id('qunit-fixture'); if ( main ) { config.fixture = main.innerHTML; } if (config.autostart) { QUnit.start(); } }; addEvent(window, "load", QUnit.load); // addEvent(window, "error") gives us a useless event object window.onerror = function( message, file, line ) { if ( QUnit.config.current ) { QUnit.pushFailure( message, file + ":" + line ); } else { QUnit.test( "global failure", function() { QUnit.pushFailure( message, file + ":" + line ); }); } }; function done() { config.autorun = true; // Log the last module results if ( config.currentModule ) { runLoggingCallbacks( 'moduleDone', QUnit, { name: config.currentModule, failed: config.moduleStats.bad, passed: config.moduleStats.all - config.moduleStats.bad, total: config.moduleStats.all } ); } var banner = id("qunit-banner"), tests = id("qunit-tests"), runtime = +new Date() - config.started, passed = config.stats.all - config.stats.bad, html = [ 'Tests completed in ', runtime, ' milliseconds.
    ', '', passed, ' tests of ', config.stats.all, ' passed, ', config.stats.bad, ' failed.' ].join(''); if ( banner ) { banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass"); } if ( tests ) { id( "qunit-testresult" ).innerHTML = html; } if ( config.altertitle && typeof document !== "undefined" && document.title ) { // show ✖ for good, ✔ for bad suite result in title // use escape sequences in case file gets loaded with non-utf-8-charset document.title = [ (config.stats.bad ? "\u2716" : "\u2714"), document.title.replace(/^[\u2714\u2716] /i, "") ].join(" "); } // clear own sessionStorage items if all tests passed if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { var key; for ( var i = 0; i < sessionStorage.length; i++ ) { key = sessionStorage.key( i++ ); if ( key.indexOf("qunit-test-") === 0 ) { sessionStorage.removeItem( key ); } } } runLoggingCallbacks( 'done', QUnit, { failed: config.stats.bad, passed: passed, total: config.stats.all, runtime: runtime } ); } function validTest( name ) { var filter = config.filter, run = false; if ( !filter ) { return true; } var not = filter.charAt( 0 ) === "!"; if ( not ) { filter = filter.slice( 1 ); } if ( name.indexOf( filter ) !== -1 ) { return !not; } if ( not ) { run = true; } return run; } // so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) // Later Safari and IE10 are supposed to support error.stack as well // See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack function extractStacktrace( e, offset ) { offset = offset || 3; if (e.stacktrace) { // Opera return e.stacktrace.split("\n")[offset + 3]; } else if (e.stack) { // Firefox, Chrome var stack = e.stack.split("\n"); if (/^error$/i.test(stack[0])) { stack.shift(); } return stack[offset]; } else if (e.sourceURL) { // Safari, PhantomJS // hopefully one day Safari provides actual stacktraces // exclude useless self-reference for generated Error objects if ( /qunit.js$/.test( e.sourceURL ) ) { return; } // for actual exceptions, this is useful return e.sourceURL + ":" + e.line; } } function sourceFromStacktrace(offset) { try { throw new Error(); } catch ( e ) { return extractStacktrace( e, offset ); } } function escapeInnerText(s) { if (!s) { return ""; } s = s + ""; return s.replace(/[\&<>]/g, function(s) { switch(s) { case "&": return "&"; case "<": return "<"; case ">": return ">"; default: return s; } }); } function synchronize( callback, last ) { config.queue.push( callback ); if ( config.autorun && !config.blocking ) { process(last); } } function process( last ) { function next() { process( last ); } var start = new Date().getTime(); config.depth = config.depth ? config.depth + 1 : 1; while ( config.queue.length && !config.blocking ) { if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { config.queue.shift()(); } else { window.setTimeout( next, 13 ); break; } } config.depth--; if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { done(); } } function saveGlobal() { config.pollution = []; if ( config.noglobals ) { for ( var key in window ) { if ( !hasOwn.call( window, key ) ) { continue; } config.pollution.push( key ); } } } function checkPollution( name ) { var old = config.pollution; saveGlobal(); var newGlobals = diff( config.pollution, old ); if ( newGlobals.length > 0 ) { QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); } var deletedGlobals = diff( old, config.pollution ); if ( deletedGlobals.length > 0 ) { QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); } } // returns a new Array with the elements that are in a but not in b function diff( a, b ) { var result = a.slice(); for ( var i = 0; i < result.length; i++ ) { for ( var j = 0; j < b.length; j++ ) { if ( result[i] === b[j] ) { result.splice(i, 1); i--; break; } } } return result; } function extend(a, b) { for ( var prop in b ) { if ( b[prop] === undefined ) { delete a[prop]; // Avoid "Member not found" error in IE8 caused by setting window.constructor } else if ( prop !== "constructor" || a !== window ) { a[prop] = b[prop]; } } return a; } function addEvent(elem, type, fn) { if ( elem.addEventListener ) { elem.addEventListener( type, fn, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, fn ); } else { fn(); } } function id(name) { return !!(typeof document !== "undefined" && document && document.getElementById) && document.getElementById( name ); } function registerLoggingCallback(key){ return function(callback){ config[key].push( callback ); }; } // Supports deprecated method of completely overwriting logging callbacks function runLoggingCallbacks(key, scope, args) { //debugger; var callbacks; if ( QUnit.hasOwnProperty(key) ) { QUnit[key].call(scope, args); } else { callbacks = config[key]; for( var i = 0; i < callbacks.length; i++ ) { callbacks[i].call( scope, args ); } } } // Test for equality any JavaScript type. // Author: Philippe Rathé QUnit.equiv = (function() { var innerEquiv; // the real equiv function var callers = []; // stack to decide between skip/abort functions var parents = []; // stack to avoiding loops from circular referencing // Call the o related callback with the given arguments. function bindCallbacks(o, callbacks, args) { var prop = QUnit.objectType(o); if (prop) { if (QUnit.objectType(callbacks[prop]) === "function") { return callbacks[prop].apply(callbacks, args); } else { return callbacks[prop]; // or undefined } } } var getProto = Object.getPrototypeOf || function (obj) { return obj.__proto__; }; var callbacks = (function () { // for string, boolean, number and null function useStrictEquality(b, a) { if (b instanceof a.constructor || a instanceof b.constructor) { // to catch short annotaion VS 'new' annotation of a // declaration // e.g. var i = 1; // var j = new Number(1); return a == b; } else { return a === b; } } return { "string" : useStrictEquality, "boolean" : useStrictEquality, "number" : useStrictEquality, "null" : useStrictEquality, "undefined" : useStrictEquality, "nan" : function(b) { return isNaN(b); }, "date" : function(b, a) { return QUnit.objectType(b) === "date" && a.valueOf() === b.valueOf(); }, "regexp" : function(b, a) { return QUnit.objectType(b) === "regexp" && // the regex itself a.source === b.source && // and its modifers a.global === b.global && // (gmi) ... a.ignoreCase === b.ignoreCase && a.multiline === b.multiline; }, // - skip when the property is a method of an instance (OOP) // - abort otherwise, // initial === would have catch identical references anyway "function" : function() { var caller = callers[callers.length - 1]; return caller !== Object && typeof caller !== "undefined"; }, "array" : function(b, a) { var i, j, loop; var len; // b could be an object literal here if (QUnit.objectType(b) !== "array") { return false; } len = a.length; if (len !== b.length) { // safe and faster return false; } // track reference to avoid circular references parents.push(a); for (i = 0; i < len; i++) { loop = false; for (j = 0; j < parents.length; j++) { if (parents[j] === a[i]) { loop = true;// dont rewalk array } } if (!loop && !innerEquiv(a[i], b[i])) { parents.pop(); return false; } } parents.pop(); return true; }, "object" : function(b, a) { var i, j, loop; var eq = true; // unless we can proove it var aProperties = [], bProperties = []; // collection of // strings // comparing constructors is more strict than using // instanceof if (a.constructor !== b.constructor) { // Allow objects with no prototype to be equivalent to // objects with Object as their constructor. if (!((getProto(a) === null && getProto(b) === Object.prototype) || (getProto(b) === null && getProto(a) === Object.prototype))) { return false; } } // stack constructor before traversing properties callers.push(a.constructor); // track reference to avoid circular references parents.push(a); for (i in a) { // be strict: don't ensures hasOwnProperty // and go deep loop = false; for (j = 0; j < parents.length; j++) { if (parents[j] === a[i]) { // don't go down the same path twice loop = true; } } aProperties.push(i); // collect a's properties if (!loop && !innerEquiv(a[i], b[i])) { eq = false; break; } } callers.pop(); // unstack, we are done parents.pop(); for (i in b) { bProperties.push(i); // collect b's properties } // Ensures identical properties name return eq && innerEquiv(aProperties.sort(), bProperties.sort()); } }; }()); innerEquiv = function() { // can take multiple arguments var args = Array.prototype.slice.apply(arguments); if (args.length < 2) { return true; // end transition } return (function(a, b) { if (a === b) { return true; // catch the most you can } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || QUnit.objectType(a) !== QUnit.objectType(b)) { return false; // don't lose time with error prone cases } else { return bindCallbacks(a, callbacks, [ b, a ]); } // apply transition with (1..n) arguments }(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length - 1))); }; return innerEquiv; }()); /** * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | * http://flesler.blogspot.com Licensed under BSD * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 * * @projectDescription Advanced and extensible data dumping for Javascript. * @version 1.0.0 * @author Ariel Flesler * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} */ QUnit.jsDump = (function() { function quote( str ) { return '"' + str.toString().replace(/"/g, '\\"') + '"'; } function literal( o ) { return o + ''; } function join( pre, arr, post ) { var s = jsDump.separator(), base = jsDump.indent(), inner = jsDump.indent(1); if ( arr.join ) { arr = arr.join( ',' + s + inner ); } if ( !arr ) { return pre + post; } return [ pre, inner + arr, base + post ].join(s); } function array( arr, stack ) { var i = arr.length, ret = new Array(i); this.up(); while ( i-- ) { ret[i] = this.parse( arr[i] , undefined , stack); } this.down(); return join( '[', ret, ']' ); } var reName = /^function (\w+)/; var jsDump = { parse: function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance stack = stack || [ ]; var parser = this.parsers[ type || this.typeOf(obj) ]; type = typeof parser; var inStack = inArray(obj, stack); if (inStack != -1) { return 'recursion('+(inStack - stack.length)+')'; } //else if (type == 'function') { stack.push(obj); var res = parser.call( this, obj, stack ); stack.pop(); return res; } // else return (type == 'string') ? parser : this.parsers.error; }, typeOf: function( obj ) { var type; if ( obj === null ) { type = "null"; } else if (typeof obj === "undefined") { type = "undefined"; } else if (QUnit.is("RegExp", obj)) { type = "regexp"; } else if (QUnit.is("Date", obj)) { type = "date"; } else if (QUnit.is("Function", obj)) { type = "function"; } else if (typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined") { type = "window"; } else if (obj.nodeType === 9) { type = "document"; } else if (obj.nodeType) { type = "node"; } else if ( // native arrays toString.call( obj ) === "[object Array]" || // NodeList objects ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) ) { type = "array"; } else { type = typeof obj; } return type; }, separator: function() { return this.multiline ? this.HTML ? '
    ' : '\n' : this.HTML ? ' ' : ' '; }, indent: function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing if ( !this.multiline ) { return ''; } var chr = this.indentChar; if ( this.HTML ) { chr = chr.replace(/\t/g,' ').replace(/ /g,' '); } return new Array( this._depth_ + (extra||0) ).join(chr); }, up: function( a ) { this._depth_ += a || 1; }, down: function( a ) { this._depth_ -= a || 1; }, setParser: function( name, parser ) { this.parsers[name] = parser; }, // The next 3 are exposed so you can use them quote: quote, literal: literal, join: join, // _depth_: 1, // This is the list of parsers, to modify them, use jsDump.setParser parsers: { window: '[Window]', document: '[Document]', error: '[ERROR]', //when no parser is found, shouldn't happen unknown: '[Unknown]', 'null': 'null', 'undefined': 'undefined', 'function': function( fn ) { var ret = 'function', name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE if ( name ) { ret += ' ' + name; } ret += '('; ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join(''); return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' ); }, array: array, nodelist: array, 'arguments': array, object: function( map, stack ) { var ret = [ ], keys, key, val, i; QUnit.jsDump.up(); if (Object.keys) { keys = Object.keys( map ); } else { keys = []; for (key in map) { keys.push( key ); } } keys.sort(); for (i = 0; i < keys.length; i++) { key = keys[ i ]; val = map[ key ]; ret.push( QUnit.jsDump.parse( key, 'key' ) + ': ' + QUnit.jsDump.parse( val, undefined, stack ) ); } QUnit.jsDump.down(); return join( '{', ret, '}' ); }, node: function( node ) { var open = QUnit.jsDump.HTML ? '<' : '<', close = QUnit.jsDump.HTML ? '>' : '>'; var tag = node.nodeName.toLowerCase(), ret = open + tag; for ( var a in QUnit.jsDump.DOMAttrs ) { var val = node[QUnit.jsDump.DOMAttrs[a]]; if ( val ) { ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' ); } } return ret + close + open + '/' + tag + close; }, functionArgs: function( fn ) {//function calls it internally, it's the arguments part of the function var l = fn.length; if ( !l ) { return ''; } var args = new Array(l); while ( l-- ) { args[l] = String.fromCharCode(97+l);//97 is 'a' } return ' ' + args.join(', ') + ' '; }, key: quote, //object calls it internally, the key part of an item in a map functionCode: '[code]', //function calls it internally, it's the content of the function attribute: quote, //node calls it internally, it's an html attribute value string: quote, date: quote, regexp: literal, //regex number: literal, 'boolean': literal }, DOMAttrs:{//attributes to dump from nodes, name=>realName id:'id', name:'name', 'class':'className' }, HTML:false,//if true, entities are escaped ( <, >, \t, space and \n ) indentChar:' ',//indentation unit multiline:true //if true, items in a collection, are separated by a \n, else just a space. }; return jsDump; }()); // from Sizzle.js function getText( elems ) { var ret = "", elem; for ( var i = 0; elems[i]; i++ ) { elem = elems[i]; // Get the text from text nodes and CDATA nodes if ( elem.nodeType === 3 || elem.nodeType === 4 ) { ret += elem.nodeValue; // Traverse everything else, except comment nodes } else if ( elem.nodeType !== 8 ) { ret += getText( elem.childNodes ); } } return ret; } //from jquery.js function inArray( elem, array ) { if ( array.indexOf ) { return array.indexOf( elem ); } for ( var i = 0, length = array.length; i < length; i++ ) { if ( array[ i ] === elem ) { return i; } } return -1; } /* * Javascript Diff Algorithm * By John Resig (http://ejohn.org/) * Modified by Chu Alan "sprite" * * Released under the MIT license. * * More Info: * http://ejohn.org/projects/javascript-diff-algorithm/ * * Usage: QUnit.diff(expected, actual) * * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick brown fox jumped jumps over" */ QUnit.diff = (function() { function diff(o, n) { var ns = {}; var os = {}; var i; for (i = 0; i < n.length; i++) { if (ns[n[i]] == null) { ns[n[i]] = { rows: [], o: null }; } ns[n[i]].rows.push(i); } for (i = 0; i < o.length; i++) { if (os[o[i]] == null) { os[o[i]] = { rows: [], n: null }; } os[o[i]].rows.push(i); } for (i in ns) { if ( !hasOwn.call( ns, i ) ) { continue; } if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) { n[ns[i].rows[0]] = { text: n[ns[i].rows[0]], row: os[i].rows[0] }; o[os[i].rows[0]] = { text: o[os[i].rows[0]], row: ns[i].rows[0] }; } } for (i = 0; i < n.length - 1; i++) { if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null && n[i + 1] == o[n[i].row + 1]) { n[i + 1] = { text: n[i + 1], row: n[i].row + 1 }; o[n[i].row + 1] = { text: o[n[i].row + 1], row: i + 1 }; } } for (i = n.length - 1; i > 0; i--) { if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null && n[i - 1] == o[n[i].row - 1]) { n[i - 1] = { text: n[i - 1], row: n[i].row - 1 }; o[n[i].row - 1] = { text: o[n[i].row - 1], row: i - 1 }; } } return { o: o, n: n }; } return function(o, n) { o = o.replace(/\s+$/, ''); n = n.replace(/\s+$/, ''); var out = diff(o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/)); var str = ""; var i; var oSpace = o.match(/\s+/g); if (oSpace == null) { oSpace = [" "]; } else { oSpace.push(" "); } var nSpace = n.match(/\s+/g); if (nSpace == null) { nSpace = [" "]; } else { nSpace.push(" "); } if (out.n.length === 0) { for (i = 0; i < out.o.length; i++) { str += '' + out.o[i] + oSpace[i] + ""; } } else { if (out.n[0].text == null) { for (n = 0; n < out.o.length && out.o[n].text == null; n++) { str += '' + out.o[n] + oSpace[n] + ""; } } for (i = 0; i < out.n.length; i++) { if (out.n[i].text == null) { str += '' + out.n[i] + nSpace[i] + ""; } else { var pre = ""; for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) { pre += '' + out.o[n] + oSpace[n] + ""; } str += " " + out.n[i].text + nSpace[i] + pre; } } } return str; }; }()); // for CommonJS enviroments, export everything if ( typeof exports !== "undefined" || typeof require !== "undefined" ) { extend(exports, QUnit); } // get at whatever the global object is, like window in browsers }( (function() {return this;}.call()) )); ================================================ FILE: test/require.js ================================================ /* RequireJS 2.1.9 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. Available via the MIT or new BSD license. see: http://github.com/jrburke/requirejs for details */ var requirejs,require,define; (function(Z){function H(b){return"[object Function]"===L.call(b)}function I(b){return"[object Array]"===L.call(b)}function y(b,c){if(b){var e;for(e=0;ethis.depCount&&!this.defined){if(H(m)){if(this.events.error&&this.map.isDefine||j.onError!==aa)try{d=i.execCb(c,m,b,d)}catch(e){a=e}else d=i.execCb(c,m,b,d);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!== this.exports?d=b.exports:void 0===d&&this.usingExports&&(d=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",v(this.error=a)}else d=m;this.exports=d;if(this.map.isDefine&&!this.ignore&&(r[c]=d,j.onResourceLoad))j.onResourceLoad(i,this.map,this.depMaps);x(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete= !0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,e=n(a.prefix);this.depMaps.push(e);s(e,"defined",u(this,function(d){var m,e;e=this.map.name;var g=this.map.parentMap?this.map.parentMap.name:null,h=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(d.normalize&&(e=d.normalize(e,function(a){return c(a,g,!0)})||""),d=n(a.prefix+"!"+e,this.map.parentMap),s(d,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})), e=l(p,d.id)){this.depMaps.push(d);if(this.events.error)e.on("error",u(this,function(a){this.emit("error",a)}));e.enable()}}else m=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),m.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];F(p,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&x(a.map.id)});v(a)}),m.fromText=u(this,function(d,c){var e=a.name,g=n(e),B=O;c&&(d=c);B&&(O=!1);q(g);t(k.config,b)&&(k.config[e]=k.config[b]);try{j.exec(d)}catch(ca){return v(A("fromtexteval", "fromText eval for "+b+" failed: "+ca,ca,[b]))}B&&(O=!0);this.depMaps.push(g);i.completeLoad(e);h([e],m)}),d.load(a.name,h,m,k)}));i.enable(e,this);this.pluginMaps[e.id]=e},enable:function(){T[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,u(this,function(a,b){var c,d;if("string"===typeof a){a=n(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=l(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;s(a,"defined",u(this,function(a){this.defineDep(b, a);this.check()}));this.errback&&s(a,"error",u(this,this.errback))}c=a.id;d=p[c];!t(N,c)&&(d&&!d.enabled)&&i.enable(a,this)}));F(this.pluginMaps,u(this,function(a){var b=l(p,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:k,contextName:b,registry:p,defined:r,urlFetched:S,defQueue:G,Module:X,makeModuleMap:n, nextTick:j.nextTick,onError:v,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=k.pkgs,c=k.shim,d={paths:!0,config:!0,map:!0};F(a,function(a,b){d[b]?"map"===b?(k.map||(k.map={}),Q(k[b],a,!0,!0)):Q(k[b],a,!0):k[b]=a});a.shim&&(F(a.shim,function(a,b){I(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);c[b]=a}),k.shim=c);a.packages&&(y(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name, location:a.location||a.name,main:(a.main||"main").replace(ja,"").replace(ea,"")}}),k.pkgs=b);F(p,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=n(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(Z,arguments));return b||a.exports&&ba(a.exports)}},makeRequire:function(a,f){function h(d,c,e){var g,k;f.enableBuildCallback&&(c&&H(c))&&(c.__requireJsBuild=!0);if("string"===typeof d){if(H(c))return v(A("requireargs", "Invalid require call"),e);if(a&&t(N,d))return N[d](p[a.id]);if(j.get)return j.get(i,d,a,h);g=n(d,a,!1,!0);g=g.id;return!t(r,g)?v(A("notloaded",'Module name "'+g+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[g]}K();i.nextTick(function(){K();k=q(n(null,a));k.skipMap=f.skipMap;k.init(d,c,e,{enabled:!0});C()});return h}f=f||{};Q(h,{isBrowser:z,toUrl:function(b){var f,e=b.lastIndexOf("."),g=b.split("/")[0];if(-1!==e&&(!("."===g||".."===g)||1h.attachEvent.toString().indexOf("[native code"))&&!W?(O=!0,h.attachEvent("onreadystatechange",b.onScriptLoad)):(h.addEventListener("load",b.onScriptLoad,!1),h.addEventListener("error", b.onScriptError,!1)),h.src=e,K=h,C?x.insertBefore(h,C):x.appendChild(h),K=null,h;if(da)try{importScripts(e),b.completeLoad(c)}catch(l){b.onError(A("importscripts","importScripts failed for "+c+" at "+e,l,[c]))}};z&&!s.skipDataMain&&M(document.getElementsByTagName("script"),function(b){x||(x=b.parentNode);if(J=b.getAttribute("data-main"))return q=J,s.baseUrl||(D=q.split("/"),q=D.pop(),fa=D.length?D.join("/")+"/":"./",s.baseUrl=fa),q=q.replace(ea,""),j.jsExtRegExp.test(q)&&(q=J),s.deps=s.deps?s.deps.concat(q): [q],!0});define=function(b,c,e){var h,j;"string"!==typeof b&&(e=c,c=b,b=null);I(c)||(e=c,c=null);!c&&H(e)&&(c=[],e.length&&(e.toString().replace(la,"").replace(ma,function(b,e){c.push(e)}),c=(1===e.length?["require"]:["require","exports","module"]).concat(c)));if(O){if(!(h=K))P&&"interactive"===P.readyState||M(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),h=P;h&&(b||(b=h.getAttribute("data-requiremodule")),j=E[h.getAttribute("data-requirecontext")])}(j? j.defQueue:R).push([b,c,e])};define.amd={jQuery:!0};j.exec=function(b){return eval(b)};j(s)}})(this); ================================================ FILE: test/tests.js ================================================ $(window).on('load', function() { //Initialize skrollr and save the instance. var s = skrollr.init({ edgeStrategy: 'set', constants: { myconst: 300, my500: function() { return 500; } }, easing: { half1: function() { return 0.5 } } }); //Counts how many assertions will be needed for the tests. var countAssertions = function(tests) { var counter = 0; for(var i = 0; i < tests.length; i++) { var curTest = tests[i]; if(curTest.styles) { $.each(curTest.styles, function() { counter++; }); } if(curTest.attributes) { $.each(curTest.attributes, function() { counter++; }); } counter += !!curTest.selector; } return counter; }; //A meta-test which runs common tests //which need synchronization of scrolling and rendering. var scrollTests = function(offset, tests) { module('at scroll position ' + offset); asyncTest('rendering', function() { //We can't run them in parallel, //because they would interfere with each others scroll top offset. stop(); expect(countAssertions(tests)); //Scroll to offset, which will cause rendering (sooner or later) s.setScrollTop(offset, true); s.on('render', function(info) { //Prevent another render event. Only need one for test. s.off('render'); for(var i = 0; i < tests.length; i++) { var curTest = tests[i]; if(curTest.styles) { $.each(curTest.styles, function(k) { QUnit.numericCSSPropertyEquals(curTest.element.css(k), curTest.styles[k], curTest.message || 'element\'s (#' + curTest.element[0].id + ') "' + k + '" CSS property is correct'); }); } if(curTest.attributes) { $.each(curTest.attributes, function(k, value) { console.log(curTest.element.prop(k)); QUnit.numericCSSPropertyEquals(curTest.element.attr(k), curTest.attributes[k], curTest.message || 'element\'s (#' + curTest.element[0].id + ') "' + k + '" attribute is correct'); }); } if(curTest.selector) { ok(curTest.element.is(curTest.selector), 'element matches "' + curTest.selector + '"'); } } start(2); }); }); }; // // Now the actual tests. // //Add one element dynamically var newElement = $('
    TEST
    ').appendTo('body'); s.refresh(newElement[0]); module('basic stuff'); test('CSS classes present', function() { strictEqual($('.skrollable').length, 23, 'All elements have the .skrollable class'); ok($('html').is('.skrollr'), 'HTML element has skrollr class'); ok($('html').is(':not(.no-skrollr)'), 'HTML element does not have no-skrollr class'); }); scrollTests(500, [ { message: 'colons inside urls are preserved (#73)', element: $('#colon-url'), styles: { backgroundImage: 'url(https://secure.travis-ci.org/Prinzhorn/skrollr.png)' } }, { message: 'a single period is no number (#74)', element: $('#period-number'), styles: { backgroundImage: 'url(https://secure.travis-ci.org/Prinzhorn/skrollr.png?1337)' } }, { element: $('#simple-numeric'), styles: { left: '100px', top: '50px' } }, { element: $('#easing'), styles: { left: '25px' } }, { element: $('#compound-numeric'), styles: { marginTop: '30px', marginRight: '20px', marginBottom: '10px', marginLeft: '0px' } }, { element: $('#rgb-color'), styles: { color: 'rgb(50, 100, 150)' } }, { element: $('#rgba-color'), styles: { color: 'rgba(50, 100, 150, 0.5)' } }, { element: $('#hsl-color'), styles: { color: 'rgb(191, 63, 63)' } }, { element: $('#no-interpolation'), styles: { right: '100px' } }, { element: $('#anchor-2'), styles: { right: '200px' } }, { element: $('#foreign-anchor'), styles: { paddingTop: '100px', paddingRight: '100px', paddingBottom: '100px', paddingLeft: '100px' } }, { element: $('#float'), styles: { float: 'left' } }, { message: 'z-index "auto" is no converted to a number (#351)', element: $('#auto-z-index'), styles: { zIndex: 'auto' } }, { message: 'attribute interpolation', element: $('#attr'), attributes: { title: '0' } } ]); scrollTests(0, [ { element: $('#simple-numeric'), styles: { left: '-100px', top: '0px' } }, { element: $('#easing'), styles: { left: '25px' } }, { element: $('#compound-numeric'), styles: { marginTop: '0px', marginRight: '10px', marginBottom: '20px', marginLeft: '30px' } }, { element: $('#rgb-color'), styles: { color: 'rgb(0, 0, 0)' } }, { element: $('#rgba-color'), styles: { color: 'rgba(0, 0, 0, 0.2)' } }, { element: $('#hsl-color'), styles: { color: 'rgb(0, 0, 0)' } }, { element: $('#no-interpolation'), styles: { right: '0px' } }, { element: $('#end'), styles: { fontSize: '10px' } }, { element: newElement, styles: { bottom: '0px' } }, { element: $('#float'), styles: { float: 'none' } }, { message: 'z-index "auto" is no converted to a number (#351)', element: $('#auto-z-index'), styles: { zIndex: '1' } }, { message: 'attribute interpolation', element: $('#attr'), attributes: { title: '500', 'data-test': 'skrollr' } } ]); scrollTests(250, [ { element: $('#simple-numeric'), styles: { left: '0px', top: '25px' } }, { element: $('#easing'), styles: { left: '25px' } }, { element: $('#compound-numeric'), styles: { marginTop: '15px', marginRight: '15px', marginBottom: '15px', marginLeft: '15px' } }, { element: $('#rgb-color'), styles: { color: 'rgb(25, 50, 75)' } }, { element: $('#rgba-color'), styles: { color: 'rgba(25, 50, 75, 0.35)' } }, { element: $('#hsl-color'), styles: { color: 'rgb(79, 47, 47)' } }, { element: $('#no-interpolation'), styles: { right: '0px' } }, { element: $('#anchor-2'), styles: { right: '100px' } }, { element: newElement, styles: { bottom: '100px' } }, { element: $('#foreign-anchor'), styles: { paddingTop: '150px', paddingRight: '150px', paddingBottom: '150px', paddingLeft: '150px' } }, { element: $('#float'), styles: { float: 'none' } }, { message: 'attribute interpolation', element: $('#attr'), attributes: { title: '250', 'data-test': 'skrollr' } } ]); //bottom-top + 50% scrollTests(150, [ { element: $('#relative-percentage-offset'), styles: { left: '250px' } } ]); //200% scrollTests(600, [ { element: $('#percentage-offset'), styles: { left: '500px' } }, { message: 'attribute interpolation', element: $('#attr'), attributes: { 'data-test': 'skrollr-test' } } ]); //100% scrollTests(300, [ { element: $('#percentage-offset'), styles: { left: '250px' } } ]); //We scroll to a ridiculous large position so that the browser cuts it at the actual position. var maxScrollHeight = s.setScrollTop(1e5) && s.getScrollTop(); scrollTests(maxScrollHeight, [ { element: $('#anchor-1'), styles: { right: '100px' } }, { element: $('#easing'), styles: { left: '50px' } }, { element: $('#easing_with_easing_strategy'), styles: { left: '25px' } }, { element: $('#reset-strategy'), styles: { left: '1337px' } } ]); });//DOM ready