Hi all
I have a site which displays a gallery of images. The user can vote on the images, and my approach has been to pass variables to a snippet which makes the call to a DB.
The syntax is something like:
domainame.com/?Var1=Val1&Var2=Val2 etc etc.
This works fine. However as the page is pretty long, whenever a user votes on an image at the bottom of the page, the page reloads and starts from the top again.
I would like the page to return to the same scroll position so the user sees the same image as he/she has just voted on.
My idea where to apply a name or id value (html) to each image, and include that in the URL.
fx.
domainame.com/?Var1=Val1&Var2#ImageName
or
domainame.com/?Var1=Val1&Var2#ImageId
I've also tried:
domainame.com/#ImageName?Var1=Val1&Var2
None of this works. The page returns to the correct image in both examples, but the snippet cease to work properly.
What is the correct syntax for using both variables and name tags?
Thanks in advance