-
script for swapping images (not mouseover)
I want to create a puzzle with 6 image slices, however i don't understand the script that i want to create. It has to switch positions with the one clicked before and after. Any help would be great thanks.
-
What code do you have so far?
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
<html>
<head>
<title>image swapping</title>
<script>
function remember(mypackage){
pictureclicked=mypackage
}
function swap(){
memory=pictureclicked.src
pictureclicked.src=sw.src
sw.src=memory
}
</script>
</head>
<body>
<table>
<tr>
<td><img id="zero" src="pic1.jpg" onclick="remember(zero)" width="80" height="100"></td>
<td><img id="one" src="pic2.jpg" onclick="remember(one)" width="80" height="100"></td>
<td><img id="two" src="pic3.jpg" onclick="remember(two)" width="80" height="100"></td>
<td><img id="three" src="pic4.jpg" onclick="remember(three)" width="80" height="100"></td>
<td><img id="four" src="pic5.jpg" onclick="remember(four)" width="80" height="100"></td>
<td><img id="five" src="pic6.jpg" onclick="remember(five)" width="80" height="100"></td>
</tr>
<tr>
<td colspan="4" align="center">
swap with<img name="sw"
src="pic1.jpg"
width="50"onclick="swap(swap)"></td>
</tr>
</table>
</body>
</html>
i just want to get rid of this piece of code so it can be able to switch from 2 pics inside the puzzle instead of going back to the "memory" one
<td colspan="4" align="center">
swap with<img name="sw"
src="pic1.jpg"
width="50"onclick="swap(swap)"></td>
-
i figured it out. but does anyone know how to make a script that counts the number clicks made to arrange the scrambled puzzle?
Similar Threads
-
By bubberz in forum ASP.NET
Replies: 2
Last Post: 08-23-2005, 02:19 PM
-
By Chris in forum Database
Replies: 3
Last Post: 08-20-2002, 12:14 AM
-
By dom in forum Architecture and Design
Replies: 0
Last Post: 04-06-2002, 01:36 AM
-
Replies: 0
Last Post: 10-29-2001, 01:55 PM
-
By Avron Polakow in forum Web
Replies: 1
Last Post: 11-06-2000, 02:09 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks