/    Sign up×
Community /Pin to ProfileBookmark

Looking for Help! I think Java could do this?

I will try to explain this as clear as possible. I am pretty sure this can be done and I would really like to display some content in my HTML (Dreamweaver) page this way. So I really need help to get this done!

What I would like to do is display an image – when the user clicks once have the image swap/load a second image – then when the user clicks again have the image swap load a third image, and so on and so forth until they get back to the first image. I would like to do this to more than one image (set) on a page so not sure if there would be conflicts. Thanks for any help or point in the right direction! I will post links on all my sites!!!

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@shieyaauthorJan 13.2007 — Does this not make sense? Or is it just not possible? Sorry for bothering...
Copy linkTweet thisAlerts:
@konithomimoJan 13.2007 — Search for "slide show", either here or on google, and you will find tens of thousands of answers. And just so you know, this is a JavaScrtip forum, not java . . . there is a big difference . . . but you need to use JS to do what you want.
Copy linkTweet thisAlerts:
@konithomimoJan 13.2007 — Here is some code to do what you want:
<html>
<head>
<script type="text/javascript">
var photos=new Array()
photos[0]="finish1.jpg"
photos[1]="finish2.jpg"
photos[2]="finish3.jpg"

function getFull(obj){
var im = obj.src.split('/');
var cur = im[im.length-1]

for(var i=0;i<photos.length;i++)
{

if(cur==photos[i]){
to = i+1;
if(to==photos.length)
to=0;
var p =new Image();
p.src = photos[to];
var h = p.height;
var w = p.width;
obj.height = h;
obj.width = w;
obj.src=photos[to];
return true;
}
}
return false;
}
</script>
</head>
<body>
<form>
<img src="finish1.jpg" id="imageplaceholder" onclick="getFull(this)">
</form>
</body>
</html>


Just put the image names into the photos[] array and then set the default image in the imageplaceholder image.
Copy linkTweet thisAlerts:
@shieyaauthorJan 13.2007 — yes! I meant JS it was just late and tired! Thank you so much I just didn't know the right search term. I was trying things like rotating images and swapping etc... coming up empty. Thank you for your feedback!
×

Success!

Help @shieya spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...