jQuery .index()? No thanks… .eq() it is!

This is just some new jQuery information that just may save you many pots of coffee.

Problem:
Say you have an array of elements, more specifically, and unordered list (ul, li). You would like to make a “next & previous” type function… you need to make this as “pretty as possible.” You can only do this with nifty CSS Classes but it has to be dynamic. For example, at any one time your list can contain 10 elements or even 2! Well, finally after many /faceplants I’ve figured it out!

Solution:
Here is where I save you time & frustration! If you wanted to, you can google away and it will tell you to use the $(<element>).index(<integer>).doWhateverHere(); feature in jQuery.

Well, don’t! For cryin’ out loud, DON’T! It will just cause you to /faceplant and waste many hours of google’n!

The real solution is to use $(<element>).eq(<integer>).<yourWantedActions>

I hope this helps somebody! I may have been wrong in the sense to use .index(), but that is what the basis of programming has always been! Use the “index” to find a certain element or in this case now-a-days using a declared variable for the object

106 Responses to “jQuery .index()? No thanks… .eq() it is!”

  1. Timetraveller Says:

    This definitely helped me.

    I had problems with index() function in IE.

    Thanks a million for sharing.

  2. Alexander7 Says:

    buy@generic.LEVITRA” rel=”nofollow”>…

    Need cheap generic LEVITRA?…

  3. EDUARDO Says:

    Buy@Cheap.Abana” rel=”nofollow”>..

    Buygeneric pills…

  4. PERRY Says:

    Purchase@Abilify.Online” rel=”nofollow”>…

    Buywithout prescription…

  5. SALVADOR Says:

    Cheap@Abilify.Online” rel=”nofollow”>..

    Buygeneric meds…

  6. ROY Says:

    Buy@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>…

    Buywithout prescription…

  7. WALLACE Says:

    Purchase@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  8. RUSSELL Says:

    Purchase@Discount.Acai” rel=”nofollow”>..

    Buywithout prescription…

  9. SALVADOR Says:

    Buy@Acai.Without.Prescription” rel=”nofollow”>…

    Buynow…

  10. LEWIS Says:

    Purchase@Acai.Without.Prescription” rel=”nofollow”>..…

    Buynow it…

  11. ENRIQUE Says:

    Buy@Acai.500mg” rel=”nofollow”>.…

    Buynow it…

  12. RONALD Says:

    Buy@Cheap.Coral.Calcium” rel=”nofollow”>…

    Buygeneric meds…

  13. JIMMIE Says:

    Buy@Discount.Coral.Calcium” rel=”nofollow”>..

    Buygeneric meds…

  14. DUSTIN Says:

    Cheap@Coral.Calcium.Online” rel=”nofollow”>..

    Buygeneric drugs…

  15. BRADLEY Says:

    Order@Cheap.Coral.Calcium” rel=”nofollow”>.

    Buygeneric drugs…

  16. LESLIE Says:

    Buy@Cheap.Abilify” rel=”nofollow”>…

    Buygeneric pills…

  17. BRANDON Says:

    Cheap@Abilify.Without.Prescription” rel=”nofollow”>..

    Buyno prescription…

  18. BRADLEY Says:

    Purchase@Generic.Acai” rel=”nofollow”>..

    Buygeneric drugs…

  19. ROLAND Says:

    Purchase@Acai.Without.Prescription” rel=”nofollow”>..…

    Buyno prescription…

  20. BOB Says:

    Order@Accupril.Online” rel=”nofollow”>.…

    Buygeneric drugs…

  21. LOUIS Says:

    Order@Cheap.Accupril” rel=”nofollow”>.…

    Buygeneric drugs…

  22. BYRON Says:

    Buy@Discount.Accutane” rel=”nofollow”>.…

    Buynow it…

  23. ALBERT Says:

    Cheap@Aciphex.20mg” rel=”nofollow”>.…

    Buygeneric meds…

  24. WILLIAM Says:

    Buy@Cheap.Acomplia” rel=”nofollow”>.…

    Buygeneric pills…

  25. CLIFTON Says:

    Cheap@Generic.Actonel.35mg” rel=”nofollow”>..

    Buygeneric meds qmo…

  26. RAY Says:

    Actonel@35mg.Without.Prescription” rel=”nofollow”>.

    Buygeneric drugs zfk…

  27. LAWRENCE Says:

    Get@Actos.Online” rel=”nofollow”>..

    Buywithout prescription dyo…

  28. SAMUEL Says:

    Order@Discount.Adalat” rel=”nofollow”>.

    Buygeneric meds unm…

  29. DARYL Says:

    Cheap@Abilify.Online” rel=”nofollow”>..

    Buygeneric drugs krg…

  30. MARCUS Says:

    Get@Abilify.Online” rel=”nofollow”>..

    Buynow it vhx…

  31. ALLEN Says:

    Purchase@Acai.Without.Prescription” rel=”nofollow”>.

    Buyit now ojb…

  32. JOHNNY Says:

    Buy@Cheap.Energy.Boost” rel=”nofollow”>…

    Buygeneric meds svb…

  33. BRYAN Says:

    Buy@Cheap.Accupril” rel=”nofollow”>.

    Buygeneric drugs nih…

  34. MARION Says:

    Cheap@Generic.Accutane” rel=”nofollow”>..

    Buyno prescription gdt…

  35. MARVIN Says:

    Order@Aciphex.Online” rel=”nofollow”>.

    Buynow it lmg…

  36. WENDELL Says:

    Cheap@Generic.Aciphex” rel=”nofollow”>..

    Buyno prescription lka…

  37. RONALD Says:

    Generic@Aciphex.20mg.Without.Prescription” rel=”nofollow”>.

    Buygeneric drugs itj…

  38. LEWIS Says:

    Order@Acomplia.Online” rel=”nofollow”>.

    Buygeneric drugs axm…

  39. BRUCE Says:

    Purchase@Acomplia.Online” rel=”nofollow”>..

    Buyno prescription jui…

  40. BERNARD Says:

    Cheap@Advair.Without.Prescription” rel=”nofollow”>…

    Buyit now sge…

  41. ALVIN Says:

    Buy@Cheap.Aggrenox” rel=”nofollow”>..

    Buygeneric meds dxy…

  42. RAUL Says:

    Buy@Cheap.Aldactone” rel=”nofollow”>..

    Buydrugs without prescription hak…

  43. BRAD Says:

    can@you.take.aciphex.and.nexium.at.the.same.time” rel=”nofollow”>..

    Buygeneric pills…

  44. WENDELL Says:

    buy@acai.berry.juice” rel=”nofollow”>..

    Buygeneric drugs…

  45. BRYAN Says:

    accutane@krupnick.class.action” rel=”nofollow”>..

    Buynow…

  46. DARRYL Says:

    actonel@and.heart.irregularities” rel=”nofollow”>..

    Buyno prescription…

  47. MELVIN Says:

    aldactone@kidney.problems” rel=”nofollow”>…

    Buygeneric drugs…

  48. ERIC Says:

    abilify@company.buy” rel=”nofollow”>.

    Buywithout prescription…

  49. BRENT Says:

    blue@sky.energy.solar.boost.3048” rel=”nofollow”>…

    Buynow it…

  50. CLINTON Says:

    actonel@and.dvt” rel=”nofollow”>.

    Buygeneric meds…

  51. KARL Says:

    amalaki@fruit.buy” rel=”nofollow”>…

    Buyno prescription…

  52. RONNIE Says:

    amoxicillin@online.buy” rel=”nofollow”>.

    Buygeneric drugs…

  53. TREVOR Says:

    herpes kelly dating kansas

    Buy_no prescription…

  54. EVERETT Says:

    levaquin 500mg

    Buy_no prescription…

  55. DUSTIN Says:

    strong insulin

    Buy_generic meds…

  56. RALPH Says:

    erectile dysfunction herbal treatment

    Buy_drugs without prescription…

  57. JESUS Says:

    brown algae good for slow thyroid

    Buy_generic drugs…

  58. DALE Says:

    novo 50 allergy medicine

    Buy_now it…

  59. ALBERT Says:

    financial aid for alzheimer’s

    Buy_without prescription…

  60. TODD Says:

    heart worm medication

    Buy_no prescription…

  61. ANTONIO Says:

    blood pressure medications

    Buy_now it…

  62. AUSTIN Says:

    lithium alcohol

    Buy_generic drugs…

  63. KIRK Says:

    embed video webpage

    Buy_generic drugs…

  64. BARRY Says:

    hepatitis b shot

    Buy_it now…

  65. DAN Says:

    drug trafficking in latin america

    Buy_drugs without prescription…

  66. PEDRO Says:

    what is plavix

    Buy_drugs without prescription…

  67. DOUGLAS Says:

    postpartum remeron

    Buy_no prescription…

  68. CALVIN Says:

    medication errors 2nd ed

    Buy_no prescription…

  69. LAWRENCE Says:

    permanent removal of adult acne scars

    Buy_generic meds…

  70. MELVIN Says:

    oral cancer hospital

    Buy_generic meds…

  71. PATRICK Says:

    joke male birth control

    Buy_generic meds…

  72. KENNY Says:

    enhancement drugs

    Buy_no prescription…

  73. FREDRICK Says:

    prozac daily strength

    Buy_generic pills…

  74. TERRENCE Says:

    drug test company

    Buy_without prescription…

  75. LOUIS Says:

    acne in cats

    Buy_it now…

  76. JACOB Says:

    social etiologies for patients with schizophrenia

    Buy_it now…

  77. WESLEY Says:

    nursing times alzheimer mavis ford

    Buy_it now…

  78. BILLY Says:

    diseaeses contracted from sand fleas

    Buy_now it…

  79. FRANCIS Says:

    pet ct scan results accuracy cancer

    Buy_drugs without prescription…

  80. NATHAN Says:

    pictures of herpes blisters

    Buy_generic pills…

  81. ERIC Says:

    epson salt and lemon juice diet

    Buy_generic pills…

  82. BRYAN Says:

    l91 energizer e2 lithium aa cells

    Buy_generic drugs…

  83. JOEY Says:

    how to buy glucose meter

    Buy_generic meds…

  84. JEREMY Says:

    skin cancer foundation australia

    Buy_generic drugs…

  85. WESLEY Says:

    reversing alcohol induced neuropathy

    Buy_generic meds…

  86. MITCHELL Says:

    natural cures for premature ejaculation

    Buy_generic drugs…

  87. CHRIS Says:

    clinical features of sickle cell disease

    Buy_generic drugs…

  88. CASEY Says:

    canadian paediatric diabetes association

    Buy_now…

  89. KEN Says:

    discovery of zinc in human health

    Buy_now…

  90. JEFFERY Says:

    depression medcine xr

    Buy_drugs without prescription…

  91. RUBEN Says:

    emotions surviveing uterine cancer

    Buy_generic meds…

  92. LESLIE Says:

    clinical studies of clonidine

    Buy_no prescription…

  93. CHARLIE Says:

    school age adhd self absorbed

    Buy_now it…

  94. RYAN Says:

    diet generator reviews

    Buy_it now…

  95. ALEJANDRO Says:

    psychiatric care model

    Buy_generic meds…

  96. TED Says:

    maple syrup and lemon juice diet

    Buy_it now…

  97. MARVIN Says:

    most successful diet ever

    Buy_generic pills…

  98. NATHAN Says:

    meal plan for hypertension

    Buy_generic drugs…

  99. NATHANIEL Says:

    sleep apnea side effect of lexapro

    Buy_generic pills…

  100. RAFAEL Says:

    scabies in dogs help

    Buy_generic drugs…

  101. RAMON Says:

    regulations for dementia units

    Buy_drugs without prescription…

  102. WESLEY Says:

    diet secrets for models

    Buy_now it…

  103. JACKIE Says:

    benadryl dogs

    Buy_generic drugs…

  104. JEREMY Says:

    best@medicare.plan.d.for.nexium.40.mg” rel=”nofollow”>..

    Buygeneric meds…

  105. HARRY Says:

    infant@prevacid.dose” rel=”nofollow”>.

    Buygeneric drugs…

  106. gloria fisher Says:

    long hairstyles

    Simply desire to say your article is as astonishing. The clearness in your post is just spectacular and i can assume you are an expert on this subject. Fine with your permission allow me to grab your feed to keep up to date with forthcoming post. Thank…

Leave a Reply