This is a migrated thread and some comments may be shown as answers.

Problem with setInterval () function

1 Answer 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 11 Nov 2020, 10:20 AM

Hello dear friends
I wrote a function that is basically a series of images with an animation function, which I want to use as a slider, but when I put it in the setInterval function to do it every 8 seconds, for example, instead of repeating, it delays 8 seconds and once the function Does, the code I wrote:

setInterval(function () { myslider() }, 3000);
    function myslider() {
        $('#slide-one-one').delay(500).fadeIn();
        $('#slide-one-two').delay(1500).animate({ 'opacity': '1', 'top': '150px', 'z-index': '3' });
        $('#slide-titr-one').delay(2500).animate({ 'opacity': '1', 'left': '600px', 'top': '40px', 'font-size': '60px' }, 'fast', function () {
            $('#slide-one').delay(2000).fadeOut(function () {
                $('#slide-two-two').animate({ 'width': '280px', 'height': '437px' }, function () {
                    $('#slide-two-man').animate({ 'bottom': '0px' }, function () {
                        $('#slide-two-titr').fadeIn('slow').animate({ 'left': '750px', 'top': '80px' }, function () {
                            $('#slide-two-one').animate({ 'opacity': '1' }, function () {
                                $('#slide-two').delay(2000).fadeOut(function () {
                                    $('#slide-tree-one').animate({ 'height': '270px' }, function () {
                                        $('#slide-tree-titr').animate({ 'opacity': '1' }, 'slow', function () {
                                            $('#slide-tree-two').fadeIn(function () {
                                                $('#slide-tree-tree').fadeIn(function () {
                                                    $('#slide-tree').delay(2000).fadeOut();
                                                });
                                            });
                                        });
                                    });
                                });
                            });
                        });
                    });
                });
            });
        });
    };

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 13 Nov 2020, 07:57 AM

Hello Matthew,

Could you please share if you are using any Kendo components in your project? I am not able to observe the problem you are having based on the provided information, so I would appreciate a small runnable Dojo example where I can see the Kendo controls and the difficulties you are experiencing.

Looking forward to your reply.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Matthew
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or