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

  • Home
  • SEARCH
  • 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 8162293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:40:33+00:00 2026-06-06T18:40:33+00:00

I need to fade in initially hidden divs which are hidden with display:none. When

  • 0

I need to fade in initially hidden divs which are hidden with display:none. When they are faded in, I need the display to be “inline-block” not “block” so they can display inline with each other rather than drop below each other. Is this possible?

.sectionBlock{
width:163px; 
height: 261px; 
padding:5px 5px; 
position: relative;  
/*display: inline-block;*/ 
display: none;
overflow: hidden; 
margin: 0 6px 11px 6px; 
}

.

...
$('.sectionBlock').fadeIn('slow');
...
  • 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-06-06T18:40:35+00:00Added an answer on June 6, 2026 at 6:40 pm

    I went for a different way of thinking about this. I am now outputting all the sectionBlocks into a hidden div and appending them to the container and fading the container in. Works perfectly.

    $('.sectionBlock').clone().appendTo($('.sectionBlockWrapper'));
    $('.sectionBlockWrapper').fadeIn('slow');
    

    I am cloning them because I am paging them and need to reuse them after emptying the container. If anyone is interested, here is my full code. Far from optimal right now but it does the trick:

    //work out how many section blocks we have
            var numberOfElements = $('.sectionBlock').length; //total number of section blocks
            var maxNumberPerPage = 8; //maximum number of blocks per 1 page layout
            var maxNumberFL = 7; //maximum number of blocks on the first and last pages
            var maxNumberMid = 6; //maximum number of blocks on the mid pages
            var virtualPage = 1; //set the start page to 1
    
            //work out the total number of pages
            var totalPages = 1;
            if (numberOfElements <= maxNumberPerPage){
                //we leave it set to 1
            } else if (numberOfElements <= (maxNumberFL*2)){
                totalPages = 2;
            } else {
                totalPages = 2;
                additionalElements = numberOfElements - (maxNumberFL*2); //because we have 14 for the first and last pages
                additionalPages = (parseInt(additionalElements/maxNumberMid)+1);
                totalPages = totalPages + additionalPages;
            }
    
            var nextButton = '<div class="sectionBlock" id="nextButton">Next >></div>'
            var prevButton = '<div class="sectionBlock" id="prevButton"><< Previous</div>'
    
    
            if (numberOfElements <= maxNumberPerPage){
                //1 page
                $('.sectionBlock').clone().appendTo($('.sectionBlockWrapper'));
                $('.sectionBlockWrapper').fadeIn('slow');
            } else {
                //we have extra pages so we only show [maxNumberFL] on the page and append the next button
                $('.sectionBlock:lt('+maxNumberFL+')').clone().appendTo($('.sectionBlockWrapper'));
                $('.sectionBlockWrapper').append(nextButton);
                $('.sectionBlockWrapper').fadeIn('slow');
            }
    
    
            $('#nextButton').live('click', function(){
                $('.sectionBlockWrapper').fadeOut('slow', function(){
                    $('.sectionBlockWrapper').empty();
                    virtualPage = virtualPage + 1;
    
                    if (numberOfElements > (maxNumberFL*2)){
                        if (virtualPage == totalPages){
                            //this is the last page of a multi page
                            var startAt = parseInt((maxNumberMid * virtualPage) -4);
                            var endAt = startAt + maxNumberMid;
                            $('.sectionBlock').slice(startAt-1,9999).clone().appendTo($('.sectionBlockWrapper'));
                            $('.sectionBlockWrapper').prepend(prevButton);
                            $('.sectionBlockWrapper').fadeIn('slow');
                        } else {
                            //this is a mid page of a multi page
                            var startAt = parseInt((maxNumberMid * virtualPage) -4);
                            var endAt = startAt + maxNumberMid;
                            $('.sectionBlock').slice(startAt-1,endAt-1).clone().appendTo($('.sectionBlockWrapper'));
                            $('.sectionBlockWrapper').prepend(prevButton);
                            $('.sectionBlockWrapper').append(nextButton);
                            $('.sectionBlockWrapper').fadeIn('slow');
                        }
                    } else {
                        //this is the second and last page
                        $('.sectionBlock').slice(maxNumberFL, maxNumberFL*virtualPage).clone().appendTo($('.sectionBlockWrapper'));
                        $('.sectionBlockWrapper').prepend(prevButton);
                        $('.sectionBlockWrapper').fadeIn('slow');
                    }
                });
            });
    
            $('#prevButton').live('click', function(){
                $('.sectionBlockWrapper').fadeOut('slow', function(){
                    $('.sectionBlockWrapper').empty();
                    virtualPage = virtualPage - 1;
    
                    if (numberOfElements > (maxNumberFL*2)){
                        if (virtualPage == 1){
                            //this is the first page of a multi page
                            var startAt = parseInt((maxNumberMid * virtualPage) -4);
                            var endAt = startAt + maxNumberMid;
                            $('.sectionBlock').slice(0,maxNumberFL).clone().appendTo($('.sectionBlockWrapper'));
                            $('.sectionBlockWrapper').append(nextButton);
                            $('.sectionBlockWrapper').fadeIn('slow');
                        } else {
                            //this is a mid page of a multi page
                            var startAt = parseInt((maxNumberMid * virtualPage) -4);
                            var endAt = startAt + maxNumberMid;
                            $('.sectionBlock').slice(startAt-1,endAt-1).clone().appendTo($('.sectionBlockWrapper'));
                            $('.sectionBlockWrapper').prepend(prevButton);
                            $('.sectionBlockWrapper').append(nextButton);
                            $('.sectionBlockWrapper').fadeIn('slow');
                        }
                    } else {
                        //this is the first page
                        $('.sectionBlock').slice(0, maxNumberFL).clone().appendTo($('.sectionBlockWrapper'));       
                        $('.sectionBlockWrapper').append(nextButton);
                        $('.sectionBlockWrapper').fadeIn('slow');
                    }
                });
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to fade in images: <script> $(window).load(function(){ $('.slides_control img').css('display', none');
I need to make the 'content' div animate after the inner divs fade out.
I need to fade content rather than scroll. How can I acheive this. I'm
I have looked around but can't find a definitive answer. I need to fade
I'm trying to have multiple divs fade in when the content of each is
I have 4 divs on a page, I need them to fade-in one after
I have a view which need to fade out before I remove it, here
I need to create a menu with divs on top of each other and
I need to fade out the parent 'content' div when clicking on either of
I need to add fade function in the following script. I need that the

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.