Jump to content

How do i send variable from page to page .. please help


yanivkalfa

Recommended Posts

i am trying to send an image address to another page . i mean i have slideshow of images .. there is an array in JS contanin all the images and when i click next the next picture is showing ..i made it possible to click on this pic as if it was a Link. now i want that when i click on that link the Address or -- what ever the array contaning in that cell will pass on to the Address that links has ..

and in that page i will just display this Info / pic full size .. hope i am understandable .

big problem is that the pics allways changing so i dont know how to move it to the address.

Link to comment
Share on other sites

I'm really not following what you are trying to do. Your question is way to general to provide any specific help. If you were to provide a link to the page you already have with some more specific instructions it would be helpful.

 

However I will try to parapharase your request into what I think you are asking.

 

You havea page in which an image is displayed. There is a next button/link on the page that will display the next image in the album. But, you also want the image itself to be a link to open the image full-size.

 

If that is correct, I would have a question for you. Do you have two versions of each image (small & large) or are you using JavaScript to change the size of the image on-the-fly?

Link to comment
Share on other sites

if you have all your images stored in an array, why dont you use the next and previous buttons to change the .src of the <IMG> tag. Create a variable that stores the current picture index and either increase it or decrease the index depending on what button was clicked by the user. This way the page would need to be refreshed everytime a button was clicked.

Link to comment
Share on other sites

I'm really not following what you are trying to do. Your question is way to general to provide any specific help. If you were to provide a link to the page you already have with some more specific instructions it would be helpful.

 

However I will try to parapharase your request into what I think you are asking.

 

You havea page in which an image is displayed. There is a next button/link on the page that will display the next image in the album. But, you also want the image itself to be a link to open the image full-size.

 

If that is correct, I would have a question for you. Do you have two versions of each image (small & large) or are you using JavaScript to change the size of the image on-the-fly?

 

Ok your the closest to the problem i have .. well i have 1 size picture .. but i get it smaller for the slideshow -- or album --- and then when i click on it its supost to jump me into another page that shows the image its self full size .

 

When you click next and the next picture is showing, is it a different url or is it dynamically changed on the same page?

its dynamic change .. couse basicaly what is do i . i have an array that cycles the pics inside it :

7.1 .2.3.4.5.6 --- then when you click next it will cycle again --- 6.7.1.2.3.4.5 ... and so on 5.6.7.1.2.3.4 ... and what i do is

document.getElementById('imgdiv0').src=Picsarray[0]

document.getElementById('imgdiv1').src=Picsarray[1]

document.getElementById('imgdiv2').src=Picsarray[2]

 

like this i change the source of  <img .. ... tag . and that how i get my pics to keep changing and my whole album to work ..

now i am trying to make it so when you click on one of the showen pics to send the pic's url to another page and in this another page i will just show it fully ..

 

i thought of

getElementById(the <a ... > </a> ID ) and change its url to soemthing like ... <a herf="blablabla?image=Picsarray[x]>

 

it might be working couse then on the next page i will have .. in post/get image the pics address and i could maybe use it ..

 

anyone maybe got a better way ?

 

Link to comment
Share on other sites

OK, I would have been VERY helpful to see the actual code you have so we could provide more concrete help as opposed to gereralities. So you apparently have the images on the page with IDs, just put the images within anchor tags such as this:

 

<a href="#" id="imgLink0"><img src="#" id="imgdiv0"></a>

 

Then modify your script to something like this:

 

document.getElementById('imgdiv0').src=Picsarray[0];
document.getElementById('imgLink0').href=Picsarray[0];

document.getElementById('imgdiv0').src=Picsarray[1];
document.getElementById('imgLink0').href=Picsarray[1];

document.getElementById('imgdiv0').src=Picsarray[2];
document.getElementById('imgLink0').href=Picsarray[2];

 

Personally I would probably take an entirely different approach, but this should work for what you already have.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.