Home Technical Talk

html question.

polycount sponsor
Offline / Send Message
malcolm polycount sponsor
I'm updating my web page and now I have all my full size images clickable to take you back to the gallery, but the scrollbar always resets which is annoying. Using the back button in the browser remembers the screen position. Any way to get this functionality in a hyper link?

Replies

  • Tulkamir
    Offline / Send Message
    Tulkamir polycounter lvl 18
    Not sure of the exact way to do exactly that, but one way around the problem could be to give the thumbnail or link bringing you to the large picture a tag name (so it would look like <a NAME="TAGNAME"><img src="img_thumb.jpg"></a> then that would bring you to your big image, if you click on the big image the html would be <a href="originalpage.html#TAGNAME"><img src=bigimage.jpg></a>, which would mean that it'd skip down to the original image clicked.

    I'm not sure if it's exactly what you want, but I think it should do the trick.
  • LoTekK
    Offline / Send Message
    LoTekK polycounter lvl 17
    quick and dirty javascript:

    <a href="javascript: history.go(-1)">Back</a>

    edit:
    didn't see tulkamir's response. His would be "cleaner" in that javascript wouldn't have to be enabled. If you're automating your page generation (so that you don't have to handcode additions to the gallery) it would be a fairly simple matter to add the tags to the auto-code, too.
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Thanks for the help from everyone on this, looks like Mitch for the win as that will be the easiest for me to implement in a text editor.
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Well I've implemented Mitch's change but unfortunately it always centers the thumbnail to the top of the screen, so basically the point of reference changes every time you click back to the gallery page. Really what I want is the cursor to land back on the thumb nail of the larger image I have just visited, surely there is a way to do this.
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Found it! This code is the same as clicking back on the browser button the corsor and scrollbar now appear exactly where I left them

    <a onClick="history.go(-1);return true;"><img
    src="ruckerdlc\ruckerdlcbig_33.jpg"

    One problem though the little hand does not appear indicating it is clickable any way to get that guy back?
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Got it finally, now I can actually get back to updating my portfolio.

    <a style="cursor:hand"; onClick="history.go(-1);return true;"><img
    src="ruckerdlc\ruckerdlcbig_33.jpg"
  • Pedro Amorim
    smile.gif hurry then! i wanna see your new stuff! love your work malcolm
Sign In or Register to comment.