Giter Club home page Giter Club logo

jquerydndpagescroll's Introduction

USE CASE:
If you are using HTML5 drag and want to drop into an element not visible in the viewport,
it is not possible on most browsers. On Google Chrome you can. Moving the dragged element
near the top or bottom of the viewport will scroll the page. But other browsers don't do
that. With this jQuery plugin, you now can.

HOW TO USE:
Simply call this function and that's it!
$().dndPageScroll();

If you're new to programming, call this in a script tag as such:
<script type="text/javascript">
	$(document).ready(function() {
		$().dndPageScroll();
	});
</script>

HOW IT WORKS:
The plugin creates invisible elements top and bottom of the viewport.
These bind the dragenter and dragover events to scroll the page.
The plugin is smart enough not to conflict with native page scroll such
as in Google Chrome.

OPTIONS:
topId: Id of DIV element put at top of the viewport. Default is
       top_scroll_page.
bottomId: Id of DIV element put at bottom of the viewport. Default
       is bottom_scroll_page.
delay: An integer indicating the number of milliseconds between
       scroll events. Default is 50.
height: An integer value how tall the top/bottom elements
        should be. Default is 20.

BROWSER SUPPORT:
Tested in the latest Chrome, Safari and FireFox.
Also test on IE9 and IE8.

Author: Martin Drapeau
Copyright: Planbox Inc. 2011
License: MIT License (http://en.wikipedia.org/wiki/MIT_License)

jquerydndpagescroll's People

Contributors

jzerbe avatar martindrapeau avatar tjbp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.