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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:49:01+00:00 2026-05-11T11:49:01+00:00

I am using jquery so that when the user clicks a link I get

  • 0

I am using jquery so that when the user clicks a link I get the id of said link then use it to select a li item with the same id and animate it. Well, at least that’s what I’m trying to do…so far I have:

$(function(){         $('#slider-buttons a').click(function(){         var x = $(this).attr('id');         var y = $('#slider-stage-list li' + x);          if(x == 'inicio')             $(this).animate({ 'left' : '0px'},700);         else             $(this).animate({ 'left' : (increment*3) + 'px'},700);     }); }); 

I’ve tried various combinations but I still can’t get ‘y’ to have the value of the list item with the same id as x (the clicked url)…x does gets the correct id but y still returns ‘undefined’ at best…here’s the html code that goes along…

<div id='slider-buttons'>     <a href='#' id='inicio'>Inicio</a> <br />     <a href='#' id='previous'>&iquest;Qui&eacute;nes Somos?</a> <br />      <a href='#' id='clases'>Clases</a> <br />     <a href='#' id='equipo'>Equipo</a> <br />     <a href='#' id='album'>&Aacute;lbum</a> <br />     <a href='#' id='especiales'>Eventos Especiales</a> <br />     <a href='#' id='#'>Cont&aacute;ctanos</a> <br /> </div> <div id='stage'>     <ul id='slider-stage-list'>         <li id='inicio'>Inicio</li>         <li id='nos'>&iquest;Qui&eacute;nes Somos?</li>         <li id='clases'>Clases</li>         <li id='equipo'>Equipo</li>         <li id='album'>&Aacute;lbum</li>         <li id='especiales'>Eventos Especiales</li>         <li id='#'>Cont&aacute;ctanos</li>     </ul> </div> 

any help will be appreciated =)


Edit to answer the 3 responses

If I do any of those I get in console.log(); ‘[object Object]’ =/


Edit answering BC

Thanks for the HTML correction, still if I write down the code you gave me for jquery I still get in console.log(); ‘[object Object]’


Edit ’cause I didn’t got the last response

If I try that approach I either get ‘[object Object]’ or nothing…

  • 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. 2026-05-11T11:49:02+00:00Added an answer on May 11, 2026 at 11:49 am

    No, no

    This is invalid html because your links are sharing the same id’s as your list items.

    Your code should look more like this:

    <div id='slider-buttons'>     <a href='#' id='inicio'>Inicio</a> <br />     <a href='#' id='previous'>&iquest;Qui&eacute;nes Somos?</a> <br />      <a href='#' id='clases'>Clases</a> <br />     <a href='#' id='equipo'>Equipo</a> <br />     <a href='#' id='album'>&Aacute;lbum</a> <br />     <a href='#' id='especiales'>Eventos Especiales</a> <br />     <a href='#' id='contactanos'>Cont&aacute;ctanos</a> <br /> </div> <div id='stage'>     <ul id='slider-stage-list'>         <li id='item_inicio'>Inicio</li>         <li id='item_previous'>&iquest;Qui&eacute;nes Somos?</li>         <li id='item_clases'>Clases</li>         <li id='item_equipo'>Equipo</li>         <li id='item_album'>&Aacute;lbum</li>         <li id='item_especiales'>Eventos Especiales</li>         <li id='item_contactanos'>Cont&aacute;ctanos</li>     </ul> </div> 

    and

    $(function(){         $('#slider-buttons a').click(function(){         var x = $(this).attr('id');         var y = $('li#item_' + x);          if(x == 'inicio')                 $(this).animate({ 'left' : '0px'},700);         else                 $(this).animate({ 'left' : (increment*3) + 'px'},700);     }); }); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer WiX is excellent. Here is a good MSDN article on… May 11, 2026 at 3:14 pm
  • added an answer Use the Application.DispatcherUnhandledException Event. See this question for a summary… May 11, 2026 at 3:14 pm
  • added an answer Hum... what you probably want to do is getsrc(){ (… May 11, 2026 at 3:14 pm

Related Questions

I am trying to make a form with some dynamic behavior. Specifically, I have
I am working on a legacy web application written in VB.NET for ASP.NET 1.1.
I have a simple form that is used to update an entity in my
I have a <div> that holds a google ad. My website is mostly AJAX

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.