Anyone handy with JavaScript here? (1 Viewer)

Ferox13

Well-Known Member
Joined
Dec 29, 2006
Messages
2,565
Location
Innsmouth
Doing a site for a Course project which needs to have some Javascript functionality. I've very new to this and I can't get it as I want.

I wanted to set up a gallery with a number of thumbnails and a main image. When you click on a thumb then the main image changes to the appropiate picture. I have tryed it here: Gallery Test
As you can see it is working but I needed to write a new function for each thumbnail click. Is there any way to combine this to a single function.
I don't know how to generate a variable with the link. This Line:


<a id = "a1" href="javascript:doChange1()"><img src="1.jpg"></a>


So that it can be taken into the function and used to change the SRC for the main image.

Any ideas?


Thanks.
 
Ok - I think I have got that...

I tryed soemthing like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN"

"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Gallery Test</title>




<script type="text/javascript">
function doChange(image_src) {
document.getElementById("image1").src="image_src"+"BIG.jpg";

}


</script>


</head>
<body>

<a id = "a1" href="javascript:doChange("1")"><img src="1.jpg"></a>
<a id = "a2" href="javascript:doChange("2")"><img src="2.jpg"></a>
<a id = "a3" href="javascript:doChange("3")"><img src="3.jpg"></a>
<a id = "a4" href="javascript:doChange("4")"><img src="4.jpg"></a>

<img id ="image1" alt="Gallery" src="Default.jpg">

</body>
</html>


So basically, I passing thru a different variable for each link (image_src) and its adding that variable to make the image source for Image1. its not working though. I think I have the sintax a bit wrong, I dunno if i should have "" when I use javascript:doChange("1").

Can you spot it? and thanks for the help.
 
i need someone to take screen grabs of an android app for me. If you have the software already set up/done it before it wont take any time at all. Cant do it meself because i cant upgrade the mac and i dont have a pc fit for purpose.

kthxbai.
 
sorry dude, from your description this is a bit outside my comfort zone at the minute.

If I understand it right though, you want some javascript code to do a screen grab of something running in a browser?

Silly question maybe but is there such a thing as an Android emulator that runs in Windows or on Mac OS? That could be an option if so.
 
sorry dude, from your description this is a bit outside my comfort zone at the minute.

If I understand it right though, you want some javascript code to do a screen grab of something running in a browser?

Silly question maybe but is there such a thing as an Android emulator that runs in Windows or on Mac OS? That could be an option if so.

not code, there are tools in existence to do it without code.

there are android emulators for osx and windows, that is the way you are supposed to do what i need to do, and that is my problem. my mac is to old an os to run any of the emulators. I cant update it for fear of losing/resetting two and half years of working on recording. My pc wont connect to the web because it was built before wifi and tethering.

I'm looking for someone who has probably already made an app or messed to load my app onto their emulator, take two screenshots and email them to me essentially.
 
I have an Adroid phone if that helps - otherwise do i need to install a emulator on my PC?

Either way - I will give it a go for you...

Is this the Emulator you recommend?
 
play-hoops.jpg


That's a visualisation of the hoops one must jump through to take a screenshot in Android.
 
I have the emulator - it says I should 'Add Android platforms and other components to your SDK.'
Where do I get these from?
 

Users who are viewing this thread

Activity
So far there's no one here
Old Thread: Hello . There have been no replies in this thread for 365 days.
Content in this thread may no longer be relevant.
Perhaps it would be better to start a new thread instead.

Support thumped.com

Support thumped.com and upgrade your account

Upgrade your account now to disable all ads...

Upgrade now

Latest threads

Latest Activity

Loading…
Back
Top