I have an Image Gallery on my site. When a user click on thumbnail image, a JavaScript function will load/change image on the imageView area.

Here is the JS function :

<SCRIPT language="JavaScript">
function changeimage(img_name,img_src) {

Here is the ImageView area code :

<IMG NAME="imageloader" SRC="image_1051.jpg" ALT="Image">

Here is the link code :

<A HREF="#"  onclick="changeimage('imageloader','image1.jpg')" >link</A>
<A HREF="#"  onclick="changeimage('imageloader','image2.jpg')" >link</A>
<A HREF="#"  onclick="changeimage('imageloader','image3.jpg')" >link</A>

Now come to my problem :
I wan to remove HREF="#" from the link code, because when anyone click on any link, the goes to top of page, and my Image Gallery is at center position of page.

Is there any way to remove the HREF="#" ? Or disable the page scrool ?

Help me please

Thank you


The problem is solved :)
I have changed the link code.

Old Code :

<A HREF="#"  onclick="changeimage('imageloader','image1.jpg')" >link</A>

New Code :

<A HREF="#"  onclick="changeimage('imageloader','image1.jpg'); return false;" >link</A>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.