Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1107197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:54:15+00:00 2026-05-17T01:54:15+00:00

Hey guys, I want to make a function loop over all elements that have

  • 0

Hey guys, I want to make a function loop over all elements that have the class of “.block-header-tabs” and do the following:

$(function(){

function cssTabs(){

var firstTab = $(".block-header-tabs").find("a:first");
var firstBlock = $(".block-header-tabs").find("a:first").attr('href');
$(firstBlock).parent().css({position: "relative"});
$(firstBlock).css({position: "absolute", zIndex: "2"})
$(firstBlock).siblings().css({opacity: "0", position: "absolute", top: "0", zIndex: "1"});
$(firstTab).addClass("tab-current");
$(firstTab).siblings().addClass("tab-noncurrent");

}

cssTabs();

$(".block-header-tabs a").click(function(){
    $(this).siblings().removeClass("tab-current").addClass("tab-noncurrent");
    $(this).removeClass("tab-noncurrent").addClass("tab-current")
    var clickedTab = $(this).attr('href');
    $(clickedTab).siblings().css({zIndex: "1"}).stop(0,0).animate({opacity:"0"}, function(){
        $(clickedTab).siblings().css({display:"none"});
    });
    $(clickedTab).css({display:"block", zIndex:"2"}).stop(0,0).animate({opacity:"1"});

    return false;

});

});

here is a link to live example so you can check it out yourselves 🙂
http://dl.dropbox.com/u/2878602/moviezet/index.html

thanks

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:54:15+00:00Added an answer on May 17, 2026 at 1:54 am

    Hey I resolved this myself, turns out that I cannot use a:first to target the main block if I want to use .each() on it. 🙂 here is the fixed code if anyone is interested:

    $(".block-header-tabs").each(function(){
        $($(this).find("a:first").attr('href')).css({position: "absolute", zIndex: "2"})
        $($(this).find("a:first").attr('href')).siblings().css({opacity: "0", position: "absolute", top: "0", zIndex: "1"});
        $($(this).find("a:first").attr('href')).parent().css({position: "relative"});
    });
    

    Thanks 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys. I have a method that gets called each second which I want
Hey guys, i have a gridview, now i want to make the rows draggable,
Hey guys I have an assigned array from mysql results and I simply want
Hey guys, I'm starting to play around with Objective-C and I want to make
hey guys, im trying to make a volunteer form, that takes info such as
So hey guys I want to return an integer to outside my OnClickListener function:
Hey ,Guys ,I have a question. I want to transform the array. [[1, [-1,
Hey guys. I have the following situation. I want to use a TypeDescriptor to
Hey guys I have setup Nivo slider to my specification, but what I want
Hey Guys I'm new to command line I want make the local changes to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.