Click to See Complete Forum and Search --> : How to move page to a html link without post...


mrtwice99
04-17-2003, 12:39 PM
I know this is probably an easy task for you seasoned programers but I can't figure it out. I would like to move my page up to a named html tag without posting the page. In this situation, if the page posts the picture goes back to the original. I would really like to move the page without any kind of post.

My code is:

function change( strControl , strPic )
{
document.images(strControl).src = strPic;
jumpTo("strControl");
}

When I click a thumbnail image it fires two functions. The first is change() and the second is "return false;" which stops the page from posting back to the server. When I click the image I want the page to automatically scroll up to the name of the html tag that is contained in strControl.

gil davis
04-17-2003, 12:47 PM
I don't know what you mean by "post".

However, you can change the "hash" of the page to navigate to an anchor usingwindow.location.hash = "strControl";

mrtwice99
04-17-2003, 01:11 PM
I meant that I did not want the page to post back. I don't want the page reloaded from the server. Everything should be done on the client side.

I inserted your code into my javascript but that was not the required effect. I noticed it inserted "#strcontrol" into my url but that is not really what I want.


<----------------- EDIT EDIT ------------------->

Actually, that is exactly what I wanted. I just changed the "strcontrol" in your code to strcontrol to extract the string and it worked. Thank you.