Mootools 1.2.4 Scroll Down/Up Using "buttons"?? div, links or images?

Discussion in 'JavaScript' started by fdoze, May 19, 2010.

  1. #1
    Hi,

    I'm using Mootools 1.2.4 and I have a DIV content ans dome HTML.

    Also I have two divs. One for button UP and one for button DOWN.

    I would like to set up button UP and DOWN to scroll the content up or down and hide the scroll bar.


    Could you please help me?

    Or give me some link to some mootools widget? Im trying to googlit but I can only find sliders...


    Thanks in advance!
     
    fdoze, May 19, 2010 IP
  2. fdoze

    fdoze Peon

    Messages:
    205
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I got it working...

    I'm using this code:

    
    	var doContentScrollUp = function() {
    		$('boxContentText').scrollTop = $('boxContentText').scrollTop-230;
    	}			
    ///
    	var doContentScrollDown = function() {
    		$('boxContentText').scrollTop = $('boxContentText').scrollTop+230;
    	}
    /////
    //
    	$('contentBtnUp').addEvent('mousedown', function(e){
    		e.stop();
    		
    		 myContentGoUp = doContentScrollUp();
    	})
    //
    	$('ContentBtnDown').addEvent('mousedown', function(e){
    		e.stop();
    		
    		 myContentGoDown = doContentScrollDown();
    	});
    //
    
    
    Code (markup):
    It may be usefull for someone else...


    Have fun!

    Thanks anyway.
     
    fdoze, May 19, 2010 IP