Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var links = ["thumb1","thumb2","thumb3","thumb4","thumb5"];
- $(document).on("click", ".thumb1", function(){
- if(!$('#thumba1').hasClass("active")) {
- if(an==0){
- an=1;
- prev = 4;
- next = 1;
- $('#arrowleft').removeClass().addClass(links[prev]);
- $('#arrowright').removeClass().addClass(links[next]);
- $('#innercontainer2').hide();
- $('#innercontainer3').hide();
- $('#innercontainer4').hide();
- $('#innercontainer5').hide();
- $('#innercontainer').fadeIn(500);
- $('#imgdiv').animate({ backgroundColor: "#25a647" }, 400);
- $('.rubrikref').animate({color: "#25a647"},400);
- $('#thumba2').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba3').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba4').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba5').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba1').css({opacity: 0.0, visibility: "visible"}).animate({opacity: 1.0});
- $('#thumba2').animate({opacity: 0.0}).css('visibility','hidden');
- $('#ref1').css('z-index','1');
- $('#ref2').css('z-index','1');
- $('#ref3').css('z-index','1');
- $('#ref4').css('z-index','1');
- $('#ref5').css('z-index','1');
- $('#ref1').css('z-index','5').fadeIn("500", function(){
- $('#ref2').css('z-index','1').hide();
- $('#ref3').css('z-index','1').hide();
- $('#ref4').css('z-index','1').hide();
- $('#ref5').css('z-index','1').hide();
- an=0;
- });
- $('#thumba1').addClass("active");
- $('#thumba2').removeClass("active");
- $('#thumba3').removeClass("active");
- $('#thumba4').removeClass("active");
- $('#thumba5').removeClass("active");
- }
- }
- });
- $(document).on("click", ".thumb2", function(){
- if(!$('#thumba2').hasClass("active")) {
- if(an==0){
- an=1;
- prev=0;
- next=2;
- $('#arrowleft').removeClass().addClass(links[prev]);
- $('#arrowright').removeClass().addClass(links[next]);
- $('#innercontainer').hide();
- $('#innercontainer3').hide();
- $('#innercontainer4').hide();
- $('#innercontainer5').hide();
- $('#innercontainer2').fadeIn(500);
- $('#imgdiv').animate({ backgroundColor: "#ff9800" }, 400);
- $('.rubrikref').animate({color: "#ff9800"},400);
- $('#thumba1').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba3').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba4').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba5').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba2').css({opacity: 0.0, visibility: "visible"}).animate({opacity: 1.0});
- $('#ref1').css('z-index','1');
- $('#ref2').css('z-index','1');
- $('#ref3').css('z-index','1');
- $('#ref4').css('z-index','1');
- $('#ref5').css('z-index','1');
- $('#ref2').css('z-index','5').fadeIn("500", function(){
- $('#ref1').css('z-index','1').hide();
- $('#ref3').css('z-index','1').hide();
- $('#ref4').css('z-index','1').hide();
- $('#ref5').css('z-index','1').hide();
- an=0;
- });
- $('#thumba2').addClass("active");
- $('#thumba1').removeClass("active");
- $('#thumba3').removeClass("active");
- $('#thumba4').removeClass("active");
- $('#thumba5').removeClass("active");
- }
- }
- });
- $(document).on("click", ".thumb3", function(){
- if(!$('#thumba3').hasClass("active")) {
- if(an==0){
- an=1;
- prev=1;
- next=3;
- $('#innercontainer').hide();
- $('#innercontainer2').hide();
- $('#innercontainer4').hide();
- $('#innercontainer5').hide();
- $('#innercontainer3').fadeIn(500);
- $('#arrowleft').removeClass().addClass(links[prev]);
- $('#arrowright').removeClass().addClass(links[next]);
- $('#imgdiv').animate({ backgroundColor: "#870301" }, 400);
- $('.rubrikref').animate({color: "#870301"},400);
- $('#thumba1').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba2').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba4').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba5').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba3').css({opacity: 0.0, visibility: "visible"}).animate({opacity: 1.0}
- $('#ref1').css('z-index','1');
- $('#ref2').css('z-index','1');
- $('#ref3').css('z-index','1');
- $('#ref4').css('z-index','1');
- $('#ref5').css('z-index','1');
- $('#ref3').css('z-index','5').fadeIn("500", function(){
- $('#ref1').css('z-index','1').hide();
- $('#ref2').css('z-index','1').hide();
- $('#ref4').css('z-index','1').hide();
- $('#ref5').css('z-index','1').hide();
- an=0;
- });
- $('#thumba3').addClass("active");
- $('#thumba1').removeClass("active");
- $('#thumba2').removeClass("active");
- $('#thumba4').removeClass("active");
- $('#thumba5').removeClass("active");
- }
- }
- });
- $(document).on("click", ".thumb4", function(){
- if(!$('#thumba4').hasClass("active")) {
- if(an==0){
- an=1;
- prev=2;
- next=4;
- $('#innercontainer').hide();
- $('#innercontainer2').hide();
- $('#innercontainer3').hide();
- $('#innercontainer5').hide();
- $('#innercontainer4').fadeIn(500);
- $('#arrowleft').removeClass().addClass(links[prev]);
- $('#arrowright').removeClass().addClass(links[next]);
- $('#imgdiv').animate({ backgroundColor: "#1a1a1a" }, 400);
- $('.rubrikref').animate({color: "#1a1a1a"},400);
- $('#thumba2').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba3').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba5').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba1').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba4').css({opacity: 0.0, visibility: "visible"}).animate({opacity: 1.0});
- $('#ref1').css('z-index','1');
- $('#ref2').css('z-index','1');
- $('#ref3').css('z-index','1');
- $('#ref4').css('z-index','1');
- $('#ref5').css('z-index','1');
- $('#ref4').css('z-index','5').fadeIn("500", function(){
- $('#ref1').css('z-index','1').hide();
- $('#ref2').css('z-index','1').hide();
- $('#ref3').css('z-index','1').hide();
- $('#ref5').css('z-index','1').hide();
- an=0;
- });
- $('#thumba4').addClass("active");
- $('#thumba1').removeClass("active");
- $('#thumba2').removeClass("active");
- $('#thumba3').removeClass("active");
- $('#thumba5').removeClass("active");
- }
- }
- });
- $(document).on("click", ".thumb5", function(){
- if(!$('#thumba5').hasClass("active")) {
- if(an==0){
- an=1;
- prev=3;
- next=0;
- $('#innercontainer').hide();
- $('#innercontainer2').hide();
- $('#innercontainer3').hide();
- $('#innercontainer4').hide();
- $('#innercontainer5').fadeIn(500);
- $('#arrowleft').removeClass().addClass(links[prev]);
- $('#arrowright').removeClass().addClass(links[next]);
- $('#imgdiv').animate({ backgroundColor: "#2d83d0" }, 400);
- $('.rubrikref').animate({color: "#2d83d0"},400);
- $('#thumba2').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba3').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba4').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba1').animate({opacity: 0.0}).css('visibility','hidden');
- $('#thumba5').css({opacity: 0.0, visibility: "visible"}).animate({opacity: 1.0});
- $('#ref1').css('z-index','1');
- $('#ref2').css('z-index','1');
- $('#ref3').css('z-index','1');
- $('#ref4').css('z-index','1');
- $('#ref5').css('z-index','1');
- $('#ref5').css('z-index','5').fadeIn("500", function(){
- $('#ref1').css('z-index','1').hide();
- $('#ref2').css('z-index','1').hide();
- $('#ref3').css('z-index','1').hide();
- $('#ref4').css('z-index','1').hide();
- an=0;
- });
- $('#thumba5').addClass("active");
- $('#thumba1').removeClass("active");
- $('#thumba2').removeClass("active");
- $('#thumba3').removeClass("active");
- $('#thumba4').removeClass("active");
- }
- }
- });
Add Comment
Please, Sign In to add comment