Bonjour

j'essaye deséspéremment de développer un slideshow en jquery... J'ai un problème avec l'orienté objet que j'ai du mal à cerner ici:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 
 
$(document).ready(function(){
  $(".slideshow").SlideShowManager();
});
 
jQuery.fn.SlideShowManager = function() {
  return this.each(function(){
    var slideshow = new SlideShow(this);
    $.extend(this, slideshow);
  });
};
 
 
function SlideShow(base){
 
  this.currentPosition = 0;
  this.slideWidth = 560;
  this.slides = $('.slide', base);
  this.numberOfSlides = this.slides.length;
 
  this.slides.wrapAll('<div class="slideInner"></div>').css({'float':'left','width':this.slideWidth});
 
  $('.slidesContainer',base).css('overflow', 'hidden');
  $('.slideInner',base).css ('width', this.slideWidth * this.numberOfSlides);
  $(base)
	.prepend('<span class="leftControl">Move left</span>')
	.append('<span  class="rightControl">Move right</span>');
 
  $('.leftControl',base).bind('click', this.onLeftControlClick);
  $('.rightControl',base).bind('click', this.onRightControlClick);
 
  this.manageControls();
}
 
SlideShow.prototype.manageControls = function(){
  if (this.currentPosition == 0){
    $('.leftControl', this).hide();
  }
  else
  {
    $('.leftControl', this).show();
  }
 
  if (this.currentPosition == (this.numberOfSlides - 1)){
    $('.rightControl', this).hide();
  }
  else
  {
    $('.rightControl', this).show();
  }
}
 
SlideShow.prototype.animate = function(){
  alert('Anime');
  $('.slideInner', this).animate({ 'marginLeft' : this.slideWidth * (-this.currentPosition)});
}
 
SlideShow.prototype.onLeftControlClick = function(){
  alert('Hit left');
  this.currentPosition++;
  this.manageControls();
  this.animate();
}
 
SlideShow.prototype.onRightControlClick = function(){
  alert('Hit Right');
  this.currentPosition--;
  this.manageControls();
  this.animate();
}
En effet, lorsque onRightControlClick() est exécutée, j'ai l'alert "hit right" pis après firebug me dit:
this.manageControls is not a function
file:///home/goundy/WebDev/JS_Training/slide/slideshow.js
Line 68
Ca me fait pareil lorsque je clique sur le left donc, comment se fait-il qu'il me dise cela ?
Pourtant j'ai crée un objet à part et j'arrive à appeler des méthodes dans des méthodes,

voici la structure du html au cas ou ca pourrait aider:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
  <div class="slideshow">
    <div class="slidesContainer">
      <div class="slide">
              textes + images... etc
      </div>
      <div class="slide">
              textes + images... etc
      </div>
      <div class="slide">
              textes + images... etc
      </div>
    </div>
  </div>
Merci d'avance