PDA

View Full Version : Don't Want Page To Refresh



Eclyps19
02-08-2006, 02:02 PM
I have this tiny bit of code...


<script language="javascript">

var level=0
var src='.jpg'

function up()
{
if(level < 10){
level = level + 1;
src = level + '.jpg'
document.images['scale'].src=src
}
}

function down()
{
if(level > 0){
level = level - 1;
src = level + '.jpg'
document.images['scale'].src=src
}
}

</script>

Here is a link to the page it's being used on.

http://still-looking.com/new_site/profile/profile03TEST.asp

is there any possible way to make it so the page doesn't scroll to the top when the arrow is pressed? If you have a really high resolution like me, you won't notice a thing but a client is using 1024x768 and it's messing up =( any help would be great. If there's not a way to do this in javascript, is there a way to do it in ASP? Thanks Guys! =D

Twey
02-08-2006, 04:16 PM
<a href="#" onMouseDown="down()"><img src="left.jpg" border="0"></a>
<a href="#" onMouseDown="up()"><img src="right.jpg" border="0"></a>Replace with:
<a href="javascript:void(0);" onclick="down();return false;"><img src="left.jpg" border="0"></a>
<a href="javascript:void(0);" onclick="up();return false;"><img src="right.jpg" border="0"></a>

Eclyps19
02-08-2006, 05:28 PM
twey to the rescue again! Thanks!