When I try to use "this" to call a function, an error occured saying :"this.slideshow_action is not a function". Can you please let me know my fault!?
var class_slider = {
current_slide: 0, //Starting Slide
total_slides: 4, //All Slides
slideshow_action: function(slide_number) {
$(".slide_text").hide();
$(".main_navigation_container").removeClass("selected");
$("#slide_" + slide_number).addClass("selected");
$("#slide_" + slide_number + "_text").fadeIn("slow");
},
slideshow: function() {
if (this.current_slide === this.total_slides)
this.current_slide = 0;//Make a new tour
else
this.current_slide++;
this.slideshow_action(this.current_slide);
},
reset_timer: function()
{
window.clearInterval(this.slideshow_timer);
this.slideshow_timer = window.setInterval(this.slideshow, 5000);
},
icon_action: function(element) {
this.reset_timer();
var arr = element.attr("id").split('_'); //Get Last Part of id(slide number)
this.current_slide = parseInt(arr[1]); //Get slide Number
this.slideshow_action(this.current_slide);
}
};