Results 1 to 3 of 3

Thread: Don't Want Page To Refresh

  1. #1
    Join Date
    Oct 2005
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Don't Want Page To Refresh

    I have this tiny bit of code...

    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/pr...file03TEST.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

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <a href="#" onMouseDown="down()"><img src="left.jpg" border="0"></a>
    <a href="#" onMouseDown="up()"><img src="right.jpg" border="0"></a>
    Replace with:
    Code:
    <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>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Oct 2005
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    twey to the rescue again! Thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •