pb appel de fonction prototypée
voila deja avec le titre vous avez une idée de mon soucis
voici la fonction:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
pausescroller.prototype.moveit=function(how){
var scrollerinstance=this
if (how==1)
{ //cycle foward
alert(temp+'ok1');
if (temp<this.content.length-1)
{
temp++;
alert(temp+'ok2');
}
else
{
temp=0;
alert(temp+'ok3');
}
}
else
{ //cycle backward
if (temp==0)
{
temp=this.content.length-1;
alert(temp+'ok4');
}
else
{
temp--;
alert(temp+'ok5');
}
}
this.hiddendivpointer=temp;
alert('scrollerinstance.hiddendivpointer='+this.hiddendivpointer);
} |
j'aimarais faire appel a cette fonction sur un Onclick d'un bouton d'un formulaire, voici ce que je fais mais qui ne marche pas:
Code:
1 2
|
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div><form name="news_bar"><input type="button" value="-" onclick="moveit(0)" class="scrollerstyle" style="width:22px; height:22px; border-right-width:0px;" name="prev" title="Previous News"><input type="button" value="+" onclick="moveit(1)" class="scrollerstyle" style="width:22px; height:22px; border-left-width:0px;" name="next" title="Next News"></form>'); |
Pour plus d'explications, demandez, merci :D