Панель Управления


Видеокурс: "Javascript+jQuery для начинающих в видеоформате" Проверка времени и определение часового пояса рабочей станции. RU-CENTER. Центр регистрации доменов зоны .RU Сейчас выгодная возможность зарегистрировать домен .РФ в RU-CENTER Информационная безопасность Система интернет-расчетов RUpay Графический редактор ГИМП (GIMP) Зинаида Лукьянова. Видеокурс Фотошоп с нуля. Евгений Попов. Видеокурс HTML + PHP + MySQL. Весь Софт Софтодром "Электрошоп". Поиск электронных товаров. Джава. Ява. Java. Дмитрий Котеров, Алексей Костарев. PHP-5. Наиболее полное руководство. 2-е издание.



Элемент Падающий (Droppable) плагина UI библиотеки jQuery.
Плагин UI версии 1.9.2 библиотеки jQuery версии 1.8.3 Сделано в kocby.ru Элемент Падающий (Droppable) плагина UI библиотеки jQuery. Плагин Падающий (jQuery UI Droppable) делает выбранные элементы Падающими (означает, что они будут приняты, когда будут брошены в роли Перетаскиваемых). Можно определить, какие перетаскиваемые будут приниматься на определенные места падения.
© Перепечатка разрешается с установкой ссылки на ресурс http://kocby.ru
Droppable :: Падающий
Описание: Создает области падения для Переносимых элементов.
Description: Create targets for draggable elements.

Пример странички Падающий дефолтный (Default functionality):
можно посмотреть здесь.

Пример странички Падающий Принимаемый (accept):
можно посмотреть здесь.

Пример странички Падающий Предохраняемый:
можно посмотреть здесь.

Пример странички Падающий Информационный:
можно посмотреть здесь.

Пример странички Падающий Возвращаемый:
можно посмотреть здесь.

Пример странички Падающий Коммерческий:
можно посмотреть здесь.

Пример странички Падающий Наглядный:
можно посмотреть здесь.




Теория

Тесты по теории можно посмотреть здесь.




Options (Опции)



accept
Type: Selector or Function()
Default: "*"

Controls which draggable elements are accepted by the droppable.
Multiple types supported:
• Selector: A selector indicating which draggable elements are accepted.
• Function: A function that will be called for each draggable on the page (passed as the first argument to the function). The function must return true if the draggable should be accepted.

Определяет, какие Перетаскиваемые элементы принимаются на место падения. Поддерживаются множественные типы:
• Selector (Селектор): Селектор, определяющий, какие Перетаскиваемые элементы принимаются на место падения.
• Function (Функция): Функция, которая будет вызвана для каждого Перетаскиваемого на страницы (передается, как первый аргумент функции). Функция должна вернуть true (истина), если Перетаскиваемый должен быть принят.

Code examples: (Примеры кода: )
Initialize the droppable with the accept option specified:
Инициализация Падающего с определенной опцией accept:

$( ".selector" ).droppable({ accept: ".special" });


Get or set the accept option, after initialization:
Можно получить или установить опцию accept после инициализации:

// getter
var accept = $( ".selector" ).droppable( "option", "accept" );
 
// setter
$( ".selector" ).droppable( "option", "accept", ".special" );



activeClass
Type: String
Default: false

If specified, the class will be added to the droppable while an acceptable draggable is being dragged.

Если определен, данный класс будет добавлен к Падающему, когда принимаемый Перетаскиваемый будет перетаскиваться.

Code examples: (Примеры кода: )
Initialize the droppable with the activeClass option specified:
Инициализация Падающего с определенной опцией activeClass:

$( ".selector" ).droppable({ activeClass: "ui-state-highlight" });


Get or set the activeClass option, after initialization:
Можно получить или установить опцию activeClass после инициализации:

// getter
var activeClass = $( ".selector" ).droppable( "option", "activeClass" );
 
// setter
$( ".selector" ).droppable( "option", "activeClass", "ui-state-highlight" );



addClasses
Type: Boolean
Default: true

If set to false, will prevent the ui-droppable class from being added. This may be desired as a performance optimization when calling .droppable() init on hundreds of elements.

Если установлено значение false (ложь), будет предотвращено добавление класса ui-droppable. Это может быть полезным для оптимизации быстродействия, когда вызов .droppable() касается нескольких сотен элементов.

Code examples: (Примеры кода: )
Initialize the droppable with the addClasses option specified:
Инициализация Падающего с определенной опцией addClasses:

$( ".selector" ).droppable({ addClasses: false });


Get or set the addClasses option, after initialization:
Можно получить или установить опцию addClasses после инициализации:

// getter
var addClasses = $( ".selector" ).droppable( "option", "addClasses" );
 
// setter
$( ".selector" ).droppable( "option", "addClasses", false );



disabled
Type: Boolean
Default: false

Disables the droppable if set to true.

Выключает Падение, если опция установлена на значение true (истина).

Code examples: (Примеры кода: )
Initialize the droppable with the disabled option specified:
Инициализация Падающего с определенной опцией disabled:

$( ".selector" ).droppable({ disabled: true });


Get or set the disabled option, after initialization:
Можно получить или установить опцию disabled после инициализации:

// getter
var disabled = $( ".selector" ).droppable( "option", "disabled" );
 
// setter
$( ".selector" ).droppable( "option", "disabled", true );



greedy
Type: Boolean
Default: false

By default, when an element is dropped on nested droppables, each droppable will receive the element. However, by setting this option to true, any parent droppables will not receive the element.

Жадный (greedy) - по умолчанию, когда элемент падает на вложенные места падения, каждое место падения получит элемент. Однако, установив опцию на значение true (истина), каждое родительское место падения не получит элемент.

Code examples: (Примеры кода: )
Initialize the droppable with the greedy option specified:
Инициализация Падающего с определенной опцией greedy:

$( ".selector" ).droppable({ greedy: true });


Get or set the greedy option, after initialization:
Можно получить или установить опцию greedy после инициализации:

// getter
var greedy = $( ".selector" ).droppable( "option", "greedy" );
 
// setter
$( ".selector" ).droppable( "option", "greedy", true );



hoverClass
Type: String
Default: false

If specified, the class will be added to the droppable while an acceptable draggable is being hovered over the droppable.

Если определен, данный класс будет добавлен к Падающему, когда принимаемый Перетаскиваемый двигается через место падения.

Code examples: (Примеры кода: )
Initialize the droppable with the hoverClass option specified:
Инициализация Падающего с определенной опцией hoverClass:

$( ".selector" ).droppable({ hoverClass: "drop-hover" });


Get or set the hoverClass option, after initialization:
Можно получить или установить опцию hoverClass после инициализации:

// getter
var hoverClass = $( ".selector" ).droppable( "option", "hoverClass" );
 
// setter
$( ".selector" ).droppable( "option", "hoverClass", "drop-hover" );



scope
Type: String
Default: false

Used to group sets of draggable and droppable items, in addition to the accept option. A draggable with the same scope value as a droppable will be accepted.

Используется для группирования множества Перетаскиваемых и Падающих элементов, в добавление к опции accept (принимать). Перетаскиваемый с тем же значением опции scope (счет), что и у Падающего будет принят.

Code examples: (Примеры кода: )
Initialize the droppable with the scope option specified:
Инициализация Падающего с определенной опцией scope:

$( ".selector" ).droppable({ scope: "tasks" });


Get or set the scope option, after initialization:
Можно получить или установить опцию scope после инициализации:

// getter
var scope = $( ".selector" ).droppable( "option", "scope" );
 
// setter
$( ".selector" ).droppable( "option", "scope", "tasks" );



tolerance
Type: String
Default: "intersect"

Specifies which mode to use for testing whether a draggable is hovering over a droppable.
Possible values:
• "fit": Draggable overlaps the droppable entirely.
• "intersect": Draggable overlaps the droppable at least 50% in both directions.
• "pointer": Mouse pointer overlaps the droppable.
• "touch": Draggable overlaps the droppable any amount.

Определяет, какой мод использовать для проверки, прошел ли Перетаскиваемый через место падения.
Возможные значения:
• "fit" (установочный мод): Перетаскиваемый полностью прошел над местом падения.
• "intersect" (пересекание): Перетаскиваемый прошел над местом падения по меньшей мере 50% пути в обоих направлениях.
• "pointer" (указательный мод): Курсор мыши над областью падения.
• "touch" (касание): Перетаскиваемый частично прошел над местом падения.

Code examples: (Примеры кода: )
Initialize the droppable with the tolerance option specified:
Инициализация Падающего с определенной опцией tolerance:

$( ".selector" ).droppable({ tolerance: "fit" });


Get or set the tolerance option, after initialization:
Можно получить или установить опцию tolerance после инициализации:

// getter
var tolerance = $( ".selector" ).droppable( "option", "tolerance" );
 
// setter
$( ".selector" ).droppable( "option", "tolerance", "fit" );



Methods (Методы)



destroy()
Removes the droppable functionality completely. This will return the element back to its pre-init state.
• This method does not accept any arguments.

Полностью удаляет функциональность Падающего. Возвращает элемент обратно в состояние до инициализации.
• Этот метод не принимает никаких аргументов.

Code examples: (Примеры кода: )
Invoke the destroy method:
Запуск метода destroy (разрушить):
$( ".selector" ).droppable( "destroy" );



disable()
Disables the droppable.
• This method does not accept any arguments.

Выключает Падающего.
• Этот метод не принимает никаких аргументов.

Code examples: (Примеры кода: )
Invoke the disable method:
Запуск метода disable (выключить):
$( ".selector" ).droppable( "disable" );



enable()
Enables the droppable.
• This method does not accept any arguments.

Включает Падающий.
• Этот метод не принимает никаких аргументов.

Code examples: (Примеры кода: )
Invoke the enable method:
Запуск метода enable (включить):
$( ".selector" ).droppable( "enable" );



option( optionName )
Returns: Object
Gets the value currently associated with the specified optionName.
Получает значение, связанное с определенным optionName (имя опции).
• optionName
Type: String
The name of the option to get.
Имя опции, для которой получаем значение.

Code examples: (Примеры кода: )
Invoke the method:
Запуск метода:
var isDisabled = $( ".selector" ).droppable( "option", "disabled" );



option()
Returns: PlainObject
Gets an object containing key/value pairs representing the current droppable options hash.
• This method does not accept any arguments.

Получает объект, содержащий пары key/value (ключ/значение), представляющий текущее состояние набора значений Падающего.
• Этот метод не принимает никаких аргументов.

Code examples: (Примеры кода: )
Invoke the method:
Запуск метода:
var options = $( ".selector" ).droppable( "option" );



option( optionName, value )
Sets the value of the droppable option associated with the specified optionName.
Устанавливает значение опции Падающего, связанное с определенным optionName (именем опции).

• optionName
Type: String
The name of the option to set.
Имя опции для установки.

• value
Type: Object
A value to set for the option.
Значение, которое устанавливается для опции.

Code examples: (Примеры кода: )
Invoke the method:
Запуск метода:
$( ".selector" ).droppable( "option", "disabled", true );



option( options )
Sets one or more options for the droppable.

Устанавливает одну или более опций для Падающего.

• options
Type: Object
A map of option-value pairs to set.
Карта пар option-value (опция-значение) для установки.

Code examples: (Примеры кода: )
Invoke the method:
Запуск метода:
$( ".selector" ).droppable( "option", { disabled: true } );



widget()
Returns a jQuery object containing the droppable element.
• This method does not accept any arguments.

Возвращает объект jQuery, содержащий падающий элемент.
• Этот метод не принимает никаких аргументов.

Code examples: (Примеры кода: )
Invoke the widget method:
Запуск метода виджета:
var widget = $( ".selector" ).droppable( "widget" );



Events (События)



activate( event, ui )
Type: dropactivate

Triggered when an accepted draggable starts dragging. This can be useful if you want to make the droppable "light up" when it can be dropped on.

• event
Type: Event

• ui
Type: Object
◦ draggable
Type: jQuery
A jQuery object representing the draggable element.
◦ helper
Type: jQuery
A jQuery object representing the helper that is being dragged.
◦ position
Type: Object
Current CSS position of the draggable helper as { top, left } object.
◦ offset
Type: Object
Current offset position of the draggable helper as { top, left } object.

Code examples: (Примеры кода: )
Initialize the droppable with the activate callback specified:
$( ".selector" ).droppable({
    activate: function( event, ui ) {}
});


Bind an event listener to the dropactivate event:
$( ".selector" ).on( "dropactivate", function( event, ui ) {} );



create( event, ui )
Type: dropcreate

Triggered when the droppable is created.

• event
Type: Event

• ui
Type: Object

Code examples: (Примеры кода: )
Initialize the droppable with the create callback specified:
$( ".selector" ).droppable({
    create: function( event, ui ) {}
});


Bind an event listener to the dropcreate event:
$( ".selector" ).on( "dropcreate", function( event, ui ) {} );



deactivate( event, ui )
Type: dropdeactivate

Triggered when an accepted draggable stops dragging.

• event
Type: Event

• ui
Type: Object
◦ draggable
Type: jQuery
A jQuery object representing the draggable element.
◦ helper
Type: jQuery
A jQuery object representing the helper that is being dragged.
◦ position
Type: Object
Current CSS position of the draggable helper as { top, left } object.
◦ offset
Type: Object
Current offset position of the draggable helper as { top, left } object.

Code examples: (Примеры кода: )
Initialize the droppable with the deactivate callback specified:
$( ".selector" ).droppable({
    deactivate: function( event, ui ) {}
});


Bind an event listener to the dropdeactivate event:
$( ".selector" ).on( "dropdeactivate", function( event, ui ) {} );



drop( event, ui )
Type: drop

Triggered when an accepted draggable is dropped on the droppable (based on the tolerance option).

• event
Type: Event

• ui
Type: Object
◦ draggable
Type: jQuery
A jQuery object representing the draggable element.
◦ helper
Type: jQuery
A jQuery object representing the helper that is being dragged.
◦ position
Type: Object
Current CSS position of the draggable helper as { top, left } object.
◦ offset
Type: Object
Current offset position of the draggable helper as { top, left } object.

Code examples: (Примеры кода: )
Initialize the droppable with the drop callback specified:
$( ".selector" ).droppable({
    drop: function( event, ui ) {}
});


Bind an event listener to the drop event:
$( ".selector" ).on( "drop", function( event, ui ) {} );



out( event, ui )
Type: dropout

Triggered when an accepted draggable is dragged out of the droppable (based on the tolerance option).

• event
Type: Event

• ui
Type: Object

Code examples: (Примеры кода: )
Initialize the droppable with the out callback specified:
$( ".selector" ).droppable({
    out: function( event, ui ) {}
});


Bind an event listener to the dropout event:
$( ".selector" ).on( "dropout", function( event, ui ) {} );



over( event, ui )
Type: dropover

Triggered when an accepted draggable is dragged over the droppable (based on the tolerance option).

• event
Type: Event

• ui
Type: Object
◦ draggable
Type: jQuery
A jQuery object representing the draggable element.
◦ helper
Type: jQuery
A jQuery object representing the helper that is being dragged.
◦ position
Type: Object
Current CSS position of the draggable helper as { top, left } object.
◦ offset
Type: Object
Current offset position of the draggable helper as { top, left } object.

Code examples: (Примеры кода: )
Initialize the droppable with the over callback specified:
$( ".selector" ).droppable({
    over: function( event, ui ) {}
});


Bind an event listener to the dropover event:
$( ".selector" ).on( "dropover", function( event, ui ) {} );



Overview (Обзор)
The jQuery UI Droppable plugin makes selected elements droppable (meaning they accept being dropped on by draggables). You can specify which draggables each will accept.

Плагин Падающий (jQuery UI Droppable) делает выбранные элементы Падающими (означает, что они будут приняты, когда будут брошены в роли Перетаскиваемых). Можно определить, какие перетаскиваемые будут приниматься на определенные места падения.




A pair of draggable and droppable elements.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>droppable demo</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css">
    <style>
    #draggable {
        width: 100px;
        height: 100px;
        background: #ccc;
    }
    #droppable {
        position: absolute;
        left: 250px;
        top: 0;
        width: 125px;
        height: 125px;
        background: #999;
        color: #fff;
        padding: 10px;
    }
    </style>
    <script src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
</head>
<body>
 
<div id="droppable">Drop here</div>
<div id="draggable">Drag me</div>
 
<script>
$( "#draggable" ).draggable();
$( "#droppable" ).droppable({
    drop: function() {
        alert( "dropped" );
    }
});
</script>
 
</body>
</html>
Этот пример можно посмотреть здесь.



Примеры Падающих на этом сайте: Дефолтный, Принимаемый, Предохраняемый, Информационный, Возвращаемый, Коммерческий, Наглядный.



Если вы планируете вернуться сюда позднее...
Пожалуйста, запомните эту страничку -
URL: http://kocby.ru/post/webmaster/jquery/ui/droppable/
Спасибо за посещение этой странички и внимательное отношение к ее контенту и дизайну. Удачи и успеха!
© KOCBY.RU :: перепечатка материалов разрешается с указанием ссылки на домен KOCBY.RU ©
Basket is empty :: Корзина пустая
Close and hide in basket :: Закрыть и спрятать в корзину
Посмотри в зеркало! Что там видно?
Красивая девушка брюнетка слева Красивая девушка блондинка справа




Close and hide in basket :: Закрыть и спрятать в корзину статистическую информацию о посетителях Клуба.
Створки зеркала Клуба Одиноких Сердец.
Красивая девушка блондинка слева Красивая девушка брюнетка справа