Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Unhappy Left-Right Manual Scroller

    I have seen them. They have an arrow on the left, and one on the right, and when you put your mouse over them, it scrolls that direction.

    I need a scroller that does this. I need to be able to use pics for the arrows, have the height and width adjustable, (That shouldn't be a prob) and be able to have a background image!!

    This is one heafty script but at least I know just what I need. If you guys can find or creat one for me, THANKS!!

    UG
    If I'm postin here, I NEED YOUR HELP!!

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First, let's clarify this. What container do you want to scroll content in? A DIV? An IFRAME? Or are you unsure?

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    content

    I want to scroll text. Links to be infact. I could use a div, or an iframe might work too.

    I would prefere an iframe now that you mention it because I need to stablize the background. I will also need help with that from some where. I have found scripts that say they do that but I have yet to get them to work.

    Also, if at all posible I would need the scrolling arrows to either be outside of the iframe. Like so...
    {IMG} {IFRAME}content{/IFRAME} {IMG}

    Thank you for any work you may put forth into finding or creating these scripts.

    UG
    Last edited by Ultragames; 08-27-2002 at 07:13 AM.
    If I'm postin here, I NEED YOUR HELP!!

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's a simple script for horizontally scrolling an IFrame
    Code:
    var scrollSpeed = 20;
    var scrollDir = "";
    var f = document.frames['iframeName']; // Your IFrame
    
    function startScroll(direction) {
    	scrollDir = direction;
    	scrollFrame();
    	}
    
    function scrollFrame() {	
    	if (scrollDir == 'left')
    		f.window.scrollBy(scrollSpeed - scrollSpeed*2,0);
    	else if (scrollDir == 'right')
    		f.window.scrollBy(scrollSpeed,0);
    	scrolling = setTimeout('scrollFrame();',scrollSpeed);
    	}
    
    function stopScroll() {
    	clearTimeout(scrolling);
    	}
    
    (...HTML...)
    
    <img src="arrow_left.gif" onMouseDown="startScroll('left')" onMouseUp="stopScroll();" />
    This is pretty similar to the scroller I use at my site, www.peterbailey.net Click on 'Workshop' and you should see what I mean

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    hmm

    I think were getting there. I arranged your code in Frontpage for a test and it didn't work. Here is how I arranged it. If theres something wrong, please let me know.

    Code:
    <html>
    
    <head>
    
    <script>
    var scrollSpeed = 20;
    var scrollDir = "";
    var f = document.frames['slider']; // Your IFrame
    
    function startScroll(direction) {
    	scrollDir = direction;
    	scrollFrame();
    	}
    
    function scrollFrame() {	
    	if (scrollDir == 'left')
    		f.window.scrollBy(scrollSpeed - scrollSpeed*2,0);
    	else if (scrollDir == 'right')
    		f.window.scrollBy(scrollSpeed,0);
    	scrolling = setTimeout('scrollFrame();',scrollSpeed);
    	}
    
    function stopScroll() {
    	clearTimeout(scrolling);
    	}
    </script>
    </head>
    
    <body>
    <img src="arrow_left.gif" onMouseUp="startScroll('left')" onMouseDown="stopScroll();">
    <iframe SRC="http://www.koin6.com" NAME="slider" WIDTH="100" HEIGHT="100" FRAMEBORDER="0"></iframe>
    </body>
    
    </html>
    If I'm postin here, I NEED YOUR HELP!!

  • #6
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    ok. . .

    I have narrowed down the problem for you. I get an error saying that f.window is either null of not on object. What might this be?
    If I'm postin here, I NEED YOUR HELP!!

  • #7
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Angry um. . .

    Anyone out there? I hope you are stil able to help Beetle!

    Thx again. . .
    If I'm postin here, I NEED YOUR HELP!!

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I'm looking at this right (without testing it), the script part of it should be on the iFrame page...

    And the controls be on the main page.

    That's what had to be done for my vertical scrollers...
    Quíet Storm Designs ~ Art is not what you see, but what you make others see.
    · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

  • #9
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    ok

    Thanks, I'll try it later.... Get back to you soon.
    If I'm postin here, I NEED YOUR HELP!!

  • #10
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Angry grrr

    Nope. I put the script on the iframe page. Now the error says 'Object expected'

    you still there beetle?
    If I'm postin here, I NEED YOUR HELP!!

  • #11
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, I'm really busy right now, but this may help

    var f = document.frames['slider']; // Your IFrame

    Is that reference accurate for your iframe? you may need top.frames or parent.frames or something like that. If f.window is causing an error, it is because f is incorrect.

    All the code should go on the same page.

  • #12
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    um

    ok, so where do I put the 'top.frames or parent.frames' thing?

    And if your asking if my iframe is named slider then yes. Other than that I dont know about acuracy.

    are you saying it must be liek this???

    Code:
    var f = top.frames['slider']; // Your IFrame
    If I'm postin here, I NEED YOUR HELP!!

  • #13
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts
    f.window.scrollBy(scrollSpeed - scrollSpeed*2,0);
    f.window.scrollBy(scrollSpeed,0);

    one of those is null or is not an object.



    Now that I put

    var f = top.frames['slider']; // Your IFrame

    instead of:

    var f = document.frames['slider']; // Your IFrame

    it says 'scrolling' is undefined.

    might I need to put something in the iframe code?
    Better idea: I could just use a div I guess. This would make it easyer I hope?? Then you could just give me the code you used for you site. . .
    Last edited by Ultragames; 08-29-2002 at 09:17 PM.
    If I'm postin here, I NEED YOUR HELP!!

  • #14
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hm, try adding scrolling to the declaring section
    Code:
    var scrollSpeed = 20;
    var scrollDir = "";
    var f = document.frames['slider']; // Your IFrame
    var scrolling;

  • #15
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    ok

    Ok, that took care of the scrolling error. Now theres just the 'f.window' error. Heres what I have now. . .

    Code:
    <script>
    var scrollSpeed = 20;
    var scrollDir = "";
    var f = top.frames['slider']; // Your IFrame
    var scrolling;
    
    function startScroll(direction) {
    	scrollDir = direction;
    	scrollFrame();
    	}
    
    function scrollFrame() {	
    	if (scrollDir == 'left')
    		f.window.scrollBy(scrollSpeed - scrollSpeed*2,0);
    	else if (scrollDir == 'right')
    		f.window.scrollBy(scrollSpeed,0);
    	scrolling = setTimeout('scrollFrame();',scrollSpeed);
    	}
    
    function stopScroll() {
    	clearTimeout(scrolling);
    	}
    </script>
    Last edited by Ultragames; 08-29-2002 at 10:30 PM.
    If I'm postin here, I NEED YOUR HELP!!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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