scriptaculous slider problem...

Discussion in 'JavaScript' started by Sleeping Troll, Jun 12, 2009.

  1. #1
    This is my code:
    	for(i=1;i<4;i++){
    		Control[i]=[];
    		Control[i].track=new Element('div',{
    			id:'track'+i
    		});
    		Control[i].handle=new Element('div',{
    			id:'handle'+i
    		});
    		Control[i].factor=new Element('a',{
    			id:'factor'+i
    		});
    		$('controls').insert(Control[i].track);
    		$('track'+i).insert(Control[i].handle);
    		$('controls').insert(Control[i].factor);
    		Control[i].slider=new Control.Slider('track'+i,'handle'+i,{
    					id:'slider'+i,															 
    					axis:'horizontal',
    					minimum:1,
    					maximum:100,
    					alignX:50,
    					onSlide:function(value){
    						$('factor'+i).innerHTML=value;
    					}
    		});
    	}
    Code (markup):
    The 'track', 'handle', and 'factor' Elements are present in the dom, but no slider is displayed? I am new to scriptaculous, what am I doing wrong?
    See problem at http://orbzorbz.com slider controls should appear on left(that is where the 'controls' div is positioned).
    p.s. no errors in firebug.
     
    Sleeping Troll, Jun 12, 2009 IP
  2. Sleeping Troll

    Sleeping Troll Peon

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Perusing the dom via firebug, I discovered that the Elements that make up the slider control have been assigned a class of 'selected', OK, understood, however they have been assigned a left property of '-100'... I'm lost!
     
    Sleeping Troll, Jun 12, 2009 IP