Speed up development with full-stack environments for every branch.

Learn More

JQuery Accordion slider [JavaScript]

Forked from How to use the jQuery $().ready function.

743 Runs 1141 Views 218 Copies

jQuery accordion slider with minimum code.

Saved

Saved

sruniti 8

sruniti
published 3 years ago

$(function () {
 
  var bannerWidth = $(".container").width();
	 var bannerview = bannerWidth/2;
     var bannerLength = ($(".slideBanner").find(".tabwrap").length) * bannerWidth;
    $(".slideBanner").css("width", bannerLength + bannerWidth);
    $(".slideBanner .tabwrap").each(function () {
        $(this).find(".tab").eq(0).css("width", bannerview )
    });
    $(".tab .selbox").click(function () {
        $(this).parent().addClass("sel").siblings().removeClass("sel");
        $(this).parent().animate({width: bannerview}, 500).siblings().stop().animate({width: "125px"}, 500);
        $(this).animate({marginLeft: "0px"}, 500).parents(".tab").siblings().find(".selbox").animate({marginLeft: -bannerview}, 500);
        $(this).parent().find(".nexttab, .pvrtab").fadeIn("slow").parents(".tab").siblings().find(".nexttab, .pvrtab").fadeOut("fast");
    }).eq(2).click();
    $(".nexttab").click(function () {
        var current = $(this).parent().index() + 1;
        $(".tab .selbox").eq(current).click()
    });
    $(".pvrtab").click(function () {
        var current = $(this).parent().index() - 1;
        $(".slideBanner .tabwrap .tab .selbox").eq(current).click()
    })
});
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).