0

I have a webpage with 2 images, mtastats.png, and mchammer.gif
I want dragging mchammer.gif over mtastats.png (which is already an a href link) to execute the click() function in my code. I have it written out, but must be doing something small wrong.
The script is at the top of the body, mtastats.png is in the cloud of ahrefs, and mchammer.gif is right below them.

Here is my page as of now, any help would be very appreciated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>2l2q.net</title>
</head>
<? include('menu.htm'); ?>
<body>
<script type="text/javascript"><!--
document.onmouseup = mouseUp;
var dragObject     = null;

function click(){
	dragObject = 1;
	}
}
function mouseUp(){
	dragObject = null;
}
function gateKeeper(){
	if(dragObject = 1){
		var password = prompt("?", "");
		if (password) { this.location.href = password + ".htm"; }
	}
}
//--></script>
<center>
<img src="img/iggysolutions.png" alt="IggySolutions" title="IggySolutions" class="placeholder"><br><br>
<a href="http://www.2l2q.net/wiki/"><img src="img/wiki.png" alt="Wiki" title="wiki" class="placeholder"></a><br>
<a href="http://www.2l2q.net/iggystats/mta/" onMouseOver="gateKeeper();"><img src="img/mtastats.png" alt="#MTA Stats" title="mta stats" class="placeholder"></a><br>
<a href="http://www.2l2q.net/mqdb/"><img src="img/mtaqdb.png" alt="MTA Quote Database" title="mta qdb" class="placeholder"></a><br><br>
<a href="http://2l2q.tumblr.com/"><img src="img/tumblr.png" alt="Tumblr" title="tumblr" class="placeholder"></a><br>
<a href="http://www.last.fm/user/Iggy248"><img src="img/last.png" alt="Last.fm" title="last.fm" class="placeholder"></a><br>
<a href="http://www.youtube.com/user/MediocreChief#g/f"><img src="img/youtube.png" alt="Youtube" title="youtube" class="placeholder"></a>
<br><br>
<img onclick="click();" src="img/McHammer.gif"><br>
<br>
<img src="/img/favicon.png" alt="egg" border="0">
</center>
</body>
</html>
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Airshow
0

HTML/Javascript has no universal native support for drag & drop so you need to either write your own drag & drop functions (not recommended) or use a javascript productivity suite such as jQuery/Prototype/MooTools.

With a bit of luck you will find a worked example somewhere on the web to do the same or very similar to what you want.

Airshow

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.