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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:28:48+00:00 2026-06-02T02:28:48+00:00

I’m trying to achieve the same blind roll down looking effect google+ has for

  • 0

I’m trying to achieve the same blind roll down looking effect google+ has for when you click to view all comments of a post. After some searching I found: http://docs.jquery.com/UI/Effects/Blind#overview but it doesn’t achieve the effect I’m after.

The code alredy present in this html isn’t the partial but the code that helps render the comments sown by default (2) when user enters the page. The partial comments are placed before this on click of a view all link and pushes them down. If more comments are typed before viewing all comments is clicked they are sliced off leaving the 2 most recent comments.

html:

<% if m.comments.any? %>


    <div class="allCommentsWrapper">
        <% comments(m.id).each do |comment| %>
             <div class="comment_container">
              <%= link_to image_tag(default_photo_for_commenter(comment), :class => "commenter_photo"), commenter(comment.user_id).username %>
         <div class="commenter_content"> <div class="userNameFontStyle"><%= link_to commenter(comment.user_id).username.capitalize, commenter(comment.user_id).username %> - <%=  simple_format h(comment.content) %> </div>
            </div><div class="comment_post_time"> <%= time_ago_in_words(comment.created_at) %> ago. </div>
        </div>
      <% end %>
    </div>


<% end %>

JQuery:

$('.view_all_comments').off().on('ajax:success', function(e){
    e.preventDefault();
    $(this).parents('.post_content').find('.comment_container').slice(0, -2).remove();
    $(this).parents('.post_content').find('.comment_container:first').before("<%= j render 'users/partials/show_all_comments', :comments => @comments %>");
    $(this).parents('.post_content').find('.allCommentsWrapper').hide().show("blind", { direction: "vertical" }, 6000);
});

Anyway this doesn’t achieve the effect I’m after. It’s like the contents are stuck to another background and as the allCommentsWrapper div is sliding down it’s revealing each comment. I want it to seem as if the comments are stuck to the div so as it’s sliding down it’s like the div is being pulled from the bottom but the top part of it is hidden but seems like it’s just behind the divs above it.

The best way to see what I mean is visit google+ and click on e.g. “23 comments” and watch them slide down.

Would appreciate a solution and some tips if possible.

Kind regards

  • 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-02T02:28:49+00:00Added an answer on June 2, 2026 at 2:28 am

    Edit: added code comments

    http://jsfiddle.net/MZzUr/51/

    How’s this?

    $("#posts").on("click", ".expander", function() {
        var commentsList = [],
            commentTemplate = $("<div/>").addClass("comment"),
            tempComment = null,
            gettingComments = new $.Deferred(),
            $this = $(this);
    
        // here you would probably have an ajax call
        // I just used a for loop
        // in the done or success of the ajax call, resolve addingComments
        // return an array of results and create in memory dom objects with jquery
        // $.get(url, data, function(results) {
        //    //add results to commentsList
        //    gettingComments.resolve()
        // });
        for (var i = 0; i < 10; i++) {
            tempComment = commentTemplate.clone().text("Comment " + i);
            commentsList.push(tempComment);
        }
        gettingComments.resolve();
    
        gettingComments.done(function() {
            // mine were added in order created, we are going to prepend them backwards
            // so reverse the list. (easier to use in recursive function)
            commentsList.reverse();
    
            // pass list to recursive function to add and animate items one at a time
            AddAndAnimate(commentsList, 30, $this);
        });
    
        function AddAndAnimate(items, delay, $container) {
            // prepend the item, get the height, then hide it
            $container.prepend(items[0]);
            var addToHeight = "+=" + items[0].height();
            items[0].hide();
    
            // animate the height change of adding the element
            // when the animation is done, show the element again,
            // remove the first element from the array, and call the recursive function
            $container.animate({
                height: addToHeight
            }, delay).promise().done(function() {
                items[0].show();
                items.splice(0, 1);
                if (items.length > 0) {
                    AddAndAnimate(items, delay, $container);
                }
            });
        }
    
    });
    

    Here is an example of how this would be accomplished. Let me know if you need help translating that to your specific example. It’s different as I don’t have your ajax functions, so I mocked the adding of comments.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
In my XML file chapters tag has more chapter tag.i need to display chapters

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.