Users Pricing

forum

Home Forums Call function in custom function – MindStick

Call function in custom function

Anonymous User 1968 03 May 2013
Hi Everyone!

I'm trying to figure out how this custom jQuery functions work by experimenting a bit. I can't however get it to work properly. I'm trying to call the prepareSlide 

function in my setInterval but it says prepareSlide is not defined

$('document').ready(function(){
    jQuery('.item_holder').itemSlider({
        start: 1,
        carousel: true
    });
});
$.fn.itemSlider = function (details) {
    var currentSlideNumber = (details && details.start > 0) ? details.start : 1;
    this.prepareSlide = function(slideNumber) {
        alert(1)
    }
    //Set an interval
    var itemToSlide = currentSlideNumber + 1;
    slideTimer = setInterval("prepareSlide(" + itemToSlide + ")", 5000);
}

Please help me!
Thanks in advance!


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md