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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:35:20+00:00 2026-06-17T22:35:20+00:00

I found unusual behavior of images when I apply jquery slideToggle effect on it.

  • 0

I found unusual behavior of images when I apply jquery slideToggle effect on it. With some effort I found that sliding effect will only work if image size is defined in pixels(px), but not if size is in percentage.

HTML

<a>Click Me</a>

<div class='target'>
    Hello Everyone...<br>
    <img src='http://i.imgur.com/MHfCk2B.jpg' height='200px' />
    <img src='http://i.imgur.com/MHfCk2B.jpg' height='10%' width='30%' />
</div>

jQuery

$(document).ready(function() {
    $('body').on('click', 'a', function() {
        $('.target').slideToggle();
    });
})

Here is jsFiddle link

Temporary solution for it is to use fadeToggle function instead.

  • 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-17T22:35:21+00:00Added an answer on June 17, 2026 at 10:35 pm

    This is solved by simply ensuring that all images are defined with pixel heights. This is actually something you can do dynamically and very simply too:

    $("img").height(function (_, h) { return h; });
    

    http://jsfiddle.net/SrWdW/2/

    I should also point out that px and % in image height/width attributes is not valid.

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

Sidebar

Related Questions

I am experiencing some unusual results with my jQuery and was hoping that somebody
While looking on some legacy code, I found a rather unusual construction (for me
I came across some unusual (to me at least...) behavior with C++'s enums. I've
I am facing some unusual problems migrating my application to work in IPv6 environments.
found this little code snippet that seems to do what i want, but im
Found a piece of code today, that I find a little smelly... TMyObject.LoadFromFile(const filename:
I am trying use javascript regular expressions to do some matching and I found
I've been working on an application and I've run across an unusual error that
I noticed some unusual activity on my website a couple days ago so I
This is probably a bit of an unusual question, in that it asks for

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.