Skip to content

fguillen/TravellingMe

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Travelling Me

Travelling Me image

Because at the end there is not end.

Versión

v0.0.1

Demo page

Requirement:

One div as container with overflow: hidden.

One element as sub-container with a fixed width and height as container of the elements to scroll.

The sub-container has to be at least as wide as the container.

Example

<div id="scroll-me" style="with: 600px; height: 200px; overflow:hidden">
  <img src="my_scroll.jpg" with="1200px" height="400px" />
</div>

$('#scroll-me').travelling();

Use:

$('#div-id').travelling();

With configuration, defaults values

$('#div-id').travelling({
  inactive_zone : 20,  // pixels arround div center where the velocity = 0
  max_velocity  : 10, // maximum pixels to move in one cycle
  fps           : 20  // frames per second
});

Support

Only tested in Chrome 13.0.782.112.

TODO

  • Allow sub-container to be less wide than the container.
  • Center sub-container.
  • suggestion: option to stop the motion when the mouse moves out of the travelling area

License

MIT License

Copyright (c) 2012 Fernando Guillen Suarez

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.

About

jQuery plugin for create infinite horizontal travelling over any div

Topics

Resources

Stars

Watchers

Forks