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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:15:21+00:00 2026-06-14T22:15:21+00:00

<ul> <li> <img src=a> </li> <li> <img src=b> </li> <li> <img src=c> </li> <li>

  • 0
<ul>
  <li>
    <img src="a">
  </li>
  <li>
    <img src="b">
  </li>
  <li>
    <img src="c">
  </li>
  <li>
    <img src="d">
  </li>
</ul> 

This is just an example, this above structure belongs to a carousel and IMG “b” is focused to the screen. I just want to know how to get the height of the previous image (that is “a”) and the next image height (that is “c”).

I tried with .closest and .siblings() but that didn’t work.

  • 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-14T22:15:22+00:00Added an answer on June 14, 2026 at 10:15 pm

    Your attempts didn’t take into account that you should move one parent up before you can get to any siblings:

    var $prevItem = $(this).parent().prev('li').children('img'), // <-- "a"
    $nextItem = $(this).parent().next('li').children('img'); // <-- "c"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div container which have several images,like this: <div style=width:600px;height:600px;> <img src=
I just wanted to know if <img src=> hurts performance in asp.net? If yes,
iwant use pyquery to do this. for example: html='<div>arya stark<img src=1111/>ahahah<img src=2222/></div>' a=PyQuery(html) i
I would like to get the SRC attribute into a variable in this example:
How do I match an URL string like this: img src = https://stackoverflow.com/a/b/c/d/someimage.jpg where
Lets say that i have img tag like this, <img src = myimage.jpg width
If the following works: alert( data.query.results.tbody[1].tr[0].td[0].span.img.src ); Why will this not work? var image
If I write something like this: var img = $(new Image()).attr('src', image.src); How can
I don't understand very well this code: var img = $('<img/>', {class: photo, src:
Regualar expression: <img[^>]+src\s*=\s*[']([^']+)['][^>]*> This works fine when 'src' is in lowercase and manages both

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.