最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

effectAllowed Property

Internet Development Index

Sets or retrieves, on the source element, which data transfer operations are allowed for the object.

Syntax

dataTransfer.effectAllowed(v) [ = sEffect ]

Possible Values

sEffectString that specifies or receives one of the following values.
copySelection is copied.
linkSelection is linked to the drop target by the data transfer operation.
moveSelection is moved to the target location when dropped.
copyLinkSelection is copied or linked, depending on the target default.
copyMoveSelection is copied or moved, depending on the target default.
linkMoveSelection is linked or moved, depending on the target default.
allAll drop effects are supported.
noneDropping is disabled and the no-drop cursor is displayed.
uninitializedDefault. No value has been set through the effectAllowed property. In this case, the default effect still works, although it cannot be queried through this property.

The property is read/write. The property has a default value of uninitialized.

Remarks

Set the effectAllowed property in the ondragstart event. This property is used most effectively with the dropEffect property.

This property can be used to override the default behavior in other applications. For example, the browser script can set the effectAllowed property to copy for a text field and thereby override the Microsoft® Word default of move. Within the browser, copy is the default effectAllowed behavior, except for anchors, which are set to link by default, and text fields, which are set to move by default.

Setting effectAllowed to none disables dropping but still displays the no-drop cursor. To avoid displaying the no-drop cursor, cancel the returnValue of the ondragstart window.

Example

This example uses the dropEffect and effectAllowed properties to move text in a drag-and-drop operation.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Example of the effectAllowed and dropEffect Properties</TITLE>
<SCRIPT>
// This function is called when the user
//  initiates a drag-and-drop operation.
function fnHandleDragStart()
{
var oData = window.event.dataTransfer;
// Set the effectAllowed on the source object.
oData.effectAllowed = "move";
}
// This function is called by the target
//  object in the ondrop event.
function fnHandleDrop()
{
var oTarg = window.event.srcElement;
var oData = window.event.dataTransfer;
// Cancel default action.
fnCancelDefault();
// Set the content of the oTarget to the information stored
//  in the data transfer object in the desired format.
oTarg.innerText += oData.getData("text");
}
// This function sets the dropEffect when the user moves the
//  mouse over the target object.
function fnHandleDragEnter()
{
var oData = window.event.dataTransfer;
// Cancel default action.
fnCancelDefault();
// Set the dropEffect for the target object.
oData.dropEffect = "move";
}
function fnCancelDefault()
{
// Cancel default action.
var oEvent = window.event;
oEvent.returnValue = false;
}
</SCRIPT>
</HEAD>
<BODY>
<H1>Example of the effectAllowed and dropEffect Properties</H1>
<P>The code in this example sets the <B>effectAllowed</B> property
to <SPAN CLASS="literal">move</SPAN>. It sets the <B>dropEffect</B>
property to display the move cursor. The default action must be
canceled in all events that are handled&#151;in this example,
<B>ondragstart</B>, <B>ondragover</B>, <B>ondragenter</B>, and
<B>ondrop</B>.</P>
<B>
[not this text]
<SPAN ID="oSource" ondragstart="fnHandleDragStart()">
[select and drag this text]
</SPAN>
[not this text]
</B>
<P><BR><P>
<DIV ID="oTarget"
STYLE="background:beige;
height:100;
width:200;
border:solid black 1px;"
ondrop="fnHandleDrop()"
ondragover="fnCancelDefault()"
ondragenter="fnHandleDragEnter()">
[drop text here]
</DIV>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this property.

Applies To

dataTransfer

See Also

About DHTML Data Transfer, clearData, getData, setData
沁阳市| 达日县| 辉县市| 伊宁县| 聂荣县| 如东县| 巧家县| 赞皇县| 瑞昌市| 浏阳市| 房山区| 休宁县| 崇阳县| 黄大仙区| 丰原市| 丰原市| 广平县| 青田县| 宣城市| 邢台县| 项城市| 蕲春县| 华池县| 开封县| 五大连池市| 平利县| 天峻县| 远安县| 安仁县| 宁阳县| 宣恩县| 论坛| 五华县| 岐山县| 营口市| 汨罗市| 江华| 乌什县| 商丘市| 永宁县| 尚义县|