Romanity
08-05-2007, 03:59 PM
Right, drag and drop works fine. I made a function so when you click save it runs a function to get the x&y co-ordinates... and for now alert them so i know its working.
<?php
ob_start();
include("config.php");
function save()
{
$topval = document.getElementById('example').style.top;
$leftval = document.getElementById('example').style.left;
echo("
<script>
alert ('$topval $leftval')
</script>
");
}
?>
<html>
<head>
<title>OurHabbo</title>
<link href="ourhabbo.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="dom-drag.js"></script>
</head>
<body class='content'>
<span class='contentHeading'>Drag & Drop Practise</span><br><Br>
<img id="example" src="lips_small.gif" style="position: relative" />
<script type="text/javascript">
Drag.init(document.getElementById("example"));
</script>
<a href='#' onClick='javascript: save();return true'>Save</a>
</body>
</html>
Theres the coding, but when i click Save, it wont alert the co-ordinates.
<?php
ob_start();
include("config.php");
function save()
{
$topval = document.getElementById('example').style.top;
$leftval = document.getElementById('example').style.left;
echo("
<script>
alert ('$topval $leftval')
</script>
");
}
?>
<html>
<head>
<title>OurHabbo</title>
<link href="ourhabbo.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="dom-drag.js"></script>
</head>
<body class='content'>
<span class='contentHeading'>Drag & Drop Practise</span><br><Br>
<img id="example" src="lips_small.gif" style="position: relative" />
<script type="text/javascript">
Drag.init(document.getElementById("example"));
</script>
<a href='#' onClick='javascript: save();return true'>Save</a>
</body>
</html>
Theres the coding, but when i click Save, it wont alert the co-ordinates.