Set Interval Of Multiple Divs in HTML Along With Common Loop For All Set

Hello Guys It's a long time back ago to share my knowledge source and real time challenge that i have faced in my company, Now I am Back With Another Interesting Topic to share with you. This is basically about the set interval function of JavaScript wrapped in a loop of three div set. The Most Simple way of scrolling images is using slider is to use multiple plugins from any site. But What happen when someone asks you to scroll all images simultaneously in a common div set and repeat next div after some interval. Here Is my experience with following demo example that i have created For You and is Successfully Launched Somewhere .

See the Demo Here For Slider With Seven Set Of Images.

http://digitaltask.in/projects/storyline-nuluv/slidemagic.html.

NOTE :- For Sliding Effects I Have Used Css Keyframes From W3c Schools

https://www.w3schools.com/cssref/css3_pr_animation-keyframes.asp

// javascript Code here //

var myIndex = 0;
carousel();

function carousel() {
    var i;
    var x = document.getElementsByClassName("storytabs");
    for (i = 0; i < x.length; i++) {
        x[i].style.display = "none";
        jQuery("div.innerright").removeClass("slideright");
        jQuery("div.halftopdv").removeClass("slidhalfrgt");
        jQuery("div.innerleft").removeClass("slideright");
        jQuery("div.tofive").removeClass("slideleft");
    }
    myIndex++;
    if (myIndex > x.length) {
        myIndex = 1
    }
    x[myIndex - 1].style.display = "block";
    setTimeout(carousel, 5000); // Change image every 2 seconds 
   jQuery("div.innerright").addClass("slideright"); 
   jQuery("div.halftopdv").addClass("slidhalfrgt"); 
   jQuery("div.innerleft").addClass("slideright"); 
   jQuery("div.tofive").addClass("slideleft");
 }
// This is just a sample script. Paste your real code (javascript or HTML) here.

    if ('this_is' == /an_example/) {
        of_beautifier();
    } else {
        var a = b ? (c % d) : e[f];
    }

0   0
Ajeet Kumar Yadav
profile Shalamar Hospital 23rd January 2024

Shalamar Hospital is home to a dedicated  child specialist . Our expert child specialist provides compassionate and top-notch pediatric care, ensuring the well-being of your little ones is in capable hands.

Write a comment ...
Post comment
Cancel
profile OSH 23rd January 2024

Secure your path to a medical career with Osh University, where  admission in mbbs  opens doors to excellence. Join a community of aspiring medical professionals, guided by expert faculty, and embark on a transformative journey.

Write a comment ...
Post comment
Cancel
profile Andrew 27th December 2023

Your post is very helpful and information is reliable. I am satisfied with your post. Thank you so much for sharing this wonderful post. Top Gun Tom Cruise Jacket 
 

Write a comment ...
Post comment
Cancel
profile Mike 27th December 2023

Thanks for sharing informative post. It is one of the best site that I have visited. Hope you will share more quality blog posts thank you.  The Fall Guy 2024 Colt Seavers Bomber Leather Jacket

Write a comment ...
Post comment
Cancel
profile Mike 27th December 2023

Thanks for sharing informative post. It is one of the best site that I have visited. Hope you will share more quality blog posts thank you.  The Fall Guy 2024 Colt Seavers Bomber Leather Jacket

Write a comment ...
Post comment
Cancel
profile Gaven 18th November 2023

I've recently stumbled upon a goldmine of stock photos that not only boast exceptional quality but also black and gold images tell a compelling story. Each image seems to convey a unique narrative, making it easier for me to communicate my ideas effectively. It's a testament to the power of visuals in storytelling, and I'm thrilled to have found a resource that strikes the perfect balance between quality and versatility.

Write a comment ...
Post comment
Cancel
profile Gaven 18th November 2023

Thank you so much for giving me the details on this.

Write a comment ...
Post comment
Cancel
profile Peter 2nd May 2023

Moving cross country from St. Paul doesn't have to break the bank. By doing your research, getting multiple quotes, and planning ahead, you can find affordable movers that fit your budget. Remember, the cost of your move depends on several factors https://azbigmedia.com/lifestyle/5-tips-for-picking-the-best-international-moving-company/

Write a comment ...
Post comment
Cancel
profile Peter 2nd May 2023

Moving cross country from St. Paul doesn't have to break the bank. By doing your research, getting multiple quotes, and planning ahead, you can find affordable movers that fit your budget. Remember, the cost of your move depends on several factors https://azbigmedia.com/lifestyle/5-tips-for-picking-the-best-international-moving-company/

Write a comment ...
Post comment
Cancel
profile marget 17th April 2023

 

Orbital sanders come in both handheld and stationary models, and they're typically lightweight and easy to use. However, they're not as powerful as belt sanders, so they may struggle with particularly tough materials. see it here

Write a comment ...
Post comment
Cancel

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site