Solved

Disable Drag and Drop in Internet Explorer?

Posted on 2004-09-14
5
698 Views
Last Modified: 2008-03-04
Hello,


Is it possible to disable Drag and Drop in IE for user when he surfs the web page?

E.g. So the user is unable to drag an Image from one frame to another.

If this is not possible by scripting, how do I achieve otherwise ?

Regards,

M PG
0
Comment
Question by:morpheous_
  • 2
5 Comments
 
LVL 33

Accepted Solution

by:
sajuks earned 50 total points
ID: 12052636
//try this,
<body onDragStart="return false">
<img name="img" src="http://experts-exchange.com/images/indexLogo.gif">
</body>
0
 

Author Comment

by:morpheous_
ID: 12053017
This works if I don'tuse the frames the way I do.

I have three frames in my frameset:

frameTop.aspx (frameTop)
n/a  (frameMain)
frameBottom.aspx (frameBottom)

frameMain is passed to frameset as attribute and doesn't exist form the start,except is created
from attributed (?href=pageurl.xml) passed from previous page.

this is the way frameset looks like:

<frameset rows="120,*,40" frameborder="NO" border="0" framespacing="0">
  <frame src="frameTop.aspx" name="frameTop" scrolling="no" noresize>
  <frame src='<%=Request.QueryString["frameMain"]%>' name="frameMain" scrolling="no" noresize>
  <frame src="frameBottom.aspx" name="frameBottom" scrolling="no" noresize>
 </frameset>


So, this way I am unable to set <body onDragStart="return false"> on the frame file that desn't exist.

Is there a way to do this somehow, shut down drag and drop on whole client / IE?


Thanx in advance!

Michael P G
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12053416
try something like,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
var obj;
var dragging = false;
var objx, objy;


function cancelEvent()
{
   window.event.returnValue = false;
}

//-->
</SCRIPT>
</HEAD>

<BODY>
<img ondragstart="cancelEvent()" src="http://experts-exchange.com/images/indexLogo.gif">
</BODY>
</HTML>

//http://bucarotechelp.com/design/97110430.asp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now