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 7033875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:07:04+00:00 2026-05-28T01:07:04+00:00

I have the following function to get the height of each div element with

  • 0

I have the following function to get the height of each div element with a particular css class. Each container has a side button composed of a div element. I can’t set the height of the button div with css because it depends on the height of the container div and each container can be a different height. So I have to do it with jquery. I am trying to set the height of the button based on the height of the container so they are equal heights. Get the container height and set the button height equal to that.

Can you help? Thank you!

// sidebar button
function SideBarBtn(){
    $('.ContactWrap').each(function(){
        var FormHeight = $(this).outerHeight();
        var SideBtnHeight = FormHeight -25 + 'px';
        $('.SideBtn').css('height', SideBtnHeight);
        $('.SideBtn').fadeIn('slow').fadeOut('slow').fadeIn('slow');
    });
}

html:

<div class="ContactWrap">
   <a href="#submit" class="SideBtn"> S u b m i t - B a r</a>
   .....
</div>
  • 1 1 Answer
  • 0 Views
  • 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-28T01:07:05+00:00Added an answer on May 28, 2026 at 1:07 am

    The problem is caused by these lines:

    $('.SideBtn').css('height', SideBtnHeight);
    $('.SideBtn').fadeIn('slow').fadeOut('slow').fadeIn('slow');
    

    These selectors select all elements with class SideBtn, and apply the new styles to it. To solve the problem, you have to use a more specific selector.

    The correct code is:

    var $btn = $(this).find('.SideBtn');
    $btn.css('height', SideBtnHeight);
    $btn.fadeIn('slow').fadeOut('slow').fadeIn('slow');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have progress.js file which has the following code $('#text_area_input').keyup(function() { var text_area_box =$(this).val();//Get
I have a bunch of elements like the following: <div class=droppableP id=s-NSW style=width:78px; height:63px;
I have the following code in html, I cannot get the Function call back
If I have following in jQuery $(#someId).add(#someOtherId).bind(click, function(e) {... I get the click bound
I have the following express node.js app. It's using the 'redis' npm package. app.get(/test,function(req,res){
I have the following code: Public Shared Function GetAvailableManufacturers() As List(Of Manufacturer) 'first get
I have an iframe in a page, with the following auto-height script. function autoHeight(e)
I have the following HTML (a snippet): <td class=ms-vb-title height=100%> <table class=ms-unselectedtitle onmouseover=OnItem(this) ctxname=ctx1
I have the following HTML: <table id=MwDataList class=data width=100% cellspacing=10px> .... <td class=centerText style=height:
I have the following markup: <select multiple=multiple id=targetFilesList style=width:200px;height:110px;> </select> <input type=button value=Get id=btnGet

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.