Board Logo

External Controls for Two Boxes
gjackson - 7/7/2004 at 02:25 AM

I use two Scroller Pro boxes on my site's home page. How can I use external controls for each box? The code I use follows:

<HEAD>
<script language="JavaScript">
<!--// external controls for left Tigra Scroller box
var b_moving = true, TScroll = [];
function toggle (o_btn){
if (b_moving){
TScroll[0].stop(2);
o_btn.value = ' Resume ';
}
else {
TScroll[0].move(2);
o_btn.value = ' Pause ';
}
b_moving = !b_moving;
return false;
}
function reverse (o_btn){
TScroll[0].step = -TScroll[0].step;
o_btn.value = (TScroll[0].step > 0 ? ' Back ' : ' Forward ');
return false;
}
// -->
</script>

<script language="JavaScript">
<!--// external controls for right Tigra Scroller box
var b_moving = true, TScroll = [];
function toggle (o_btn){
if (b_moving){
TScroll[1].stop(2);
o_btn.value = ' Resume ';
}
else {
TScroll[1].move(2);
o_btn.value = ' Pause ';
}
b_moving = !b_moving;
return false;
}
function reverse (o_btn){
TScroll[1].step = -TScroll[1].step;
o_btn.value = (TScroll[1].step > 0 ? ' Back ' : ' Forward ');
return false;
}
// -->
</script>
</HEAD>

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
new TScroll_init (Tscr_LOOK0, Tscr_BEHAVE0, Tscr_ITEMS0);
// -->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
<!--
new TScroll_init (Tscr_LOOK1, Tscr_BEHAVE1, Tscr_ITEMS1);
// -->
</SCRIPT>
</BODY>


rock - 7/7/2004 at 07:33 AM

You should diverse somehow actions of external controls:
1. Use different functions (toggle1, toggle2)
2. Use additional function argument toggle(o_button, n_scroller)


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/