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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:36:40+00:00 2026-05-31T11:36:40+00:00

I had this problem: I was trying to do the Twitter Effect, so when

  • 0

I had this problem:

I was trying to do the Twitter Effect, so when you click on it,
checks if it’s either :first or :last, and if it isn’t, create a
margin-top and margin-bottom just like in Twitter’s Timeline. I
want to create this effect when clicking in any of “One phrase here”.

The main problem was that my jQuery code doesn’t detect :first and
:last. I already tried also with :first-child and it did the same.

Using this HTML code:

<div class="phrases-container">
    <div class="phrases-title">Titulo</div>
    <div class="phrases-list">
        <div class="phrases-item zooming">First child</div>
        <div class="phrases-item zooming">One phrase</div>
        <div class="phrases-item zooming">One phrase</div>
        <div class="phrases-item zooming">Last child</div>
    </div>
    <div class="phrases-load-more">
        <a class="link loadMore">Get more phrases!</a>
    </div>
</div>

Using this jQuery code, I could fix it. Thanks for your help! (:

$(".zooming").live('click', function(){
    var $z = $('.zooming');
    index = $z.index(this);
    var bradiust = $(this).css("borderTopLeftRadius");
    if (bradiust == '0px') 
        var thand = "show";
    else 
        var thand = "hide";
    if (thand == "show"){
        if (index == 0 ){
            alert("This is the first");
        }else
        if (index == ($z.length-1)){
            alert("This is the last");
        }else{
            alert("This is just another");
        }
    }else{
        if (index == 0 ){
            alert("This is the first");
        }else
        if (index == ($z.length-1)){
            alert("This is the last");
        }else{
            alert("This is just another");

        }
    }

});
  • 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-31T11:36:42+00:00Added an answer on May 31, 2026 at 11:36 am

    I’m not quite sure what is wrong with :first, but how about this:

    var $z = $('.zooming'),
        index = $z.index(this);
    
    if (index == 0 || index == ($z.length-1)) {
        return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seems like just yesterday I had this same problem with Play! v1. After trying
I have had this problem for a while, still trying to work on a
I had this problem before and can't for life of me remember how to
I had this problem some time ago and I gave up but lately it
I've had this problem many times before, and I've never had a solution I
I've had this problem a couple of times. Let's say I want to display
Has anyone had this problem? I deleted a column in the table editor and
I know I've had this problem before so I'm really frustrated. I've got the
I have had this problem w/ two seperate WYSWYG editors in my rails application
Has anyone had this problem? My projects tend to have some long XML files

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.