Solved

Disable Drag and Drop in Internet Explorer?

Posted on 2004-09-14
5
694 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
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…

747 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

12 Experts available now in Live!

Get 1:1 Help Now