Javascript-форум (https://javascript.ru/forum/)
-   jQuery (https://javascript.ru/forum/jquery/)
-   -   Как обраться к полю? (https://javascript.ru/forum/jquery/53880-kak-obratsya-k-polyu.html)

xmlns 22.02.2015 19:40

Как обраться к полю?
 
Друзья, помогайте, JS парит.
Есть плагин:
(function($)
{
    $.fn.imageSlider = function(options)
    {
        var defaults = {
            speed: 500,
            duration: 5000,
            animation: 'hLines'
        };
        return this.each(function() {
            ...
            this.current = 0;
            ...
            
            function changeSlide(id)
            {
                alert(this.current);
            }
        });
    };
})(jQuery);

Как получить current в функции changeSlide? В JS вообще есть хоть какой-нибудь адекватный ООП?

рони 22.02.2015 19:54

Цитата:

Сообщение от xmlns
this.each(function(i, el)

Цитата:

Сообщение от xmlns
alert(el.current);

:-?


Часовой пояс GMT +3, время: 06:29.