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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:57:55+00:00 2026-05-25T18:57:55+00:00

I am using jQuery to simply toggle a <div> . I set the item

  • 0

I am using jQuery to simply toggle a <div>. I set the item being toggled to display: inline; in my CSS so it does not show, and when the item is toggled I see in my Chrome’s Inspector the item gets set to display: block;

Is it possible to have this set to display: inline-block instead? If this isn’t clear enough I’ll provide you with my code…I just don’t happen to have it with my right now.

  • 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-25T18:57:55+00:00Added an answer on May 25, 2026 at 6:57 pm

    You can. but it’s not a particularly good idea. It involves tapping in to jQuery’s internal _data method, and overriding the browser’s determined default display property.

    Code:

    $(function() {
        $(".toggler").click(function() {
            var dom = $(".showhide");
            jQuery._data(dom[0],"olddisplay","inline-block");
            dom.toggle();
        });
    });
    

    Example: http://jsfiddle.net/bstakes/2ncW5/

    I would recommend using some type of class switching, as mentioned in the comments.

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

Sidebar

Related Questions

I have created a tabbed display with html/css. I simply want to use jQuery
I am using jQuery UI for an inline datepicker. By simply calling it on
I am using Jquery to toggle a hidden (by default) div on page 1.
I am simply looking for a way of using drag and drop without jquery
I'm using the simple jQuery DIV refresh code. var refreshId = setInterval(function() { $('#refreshdash').load('dashboard.php?cache=');
I want to do a simple drag-drop using jQuery. I have not done anything
I have a simple piece of jquery i am using to toggle the visibility
I'm using simple jQuery toggle method: $('fieldset').click(function () { $('fieldset>ul').toggle(slow); }); Is there any
I'm building web a javascript application using jquery, knockoutjs and less (for css). Works
I'm using Jquery's toggle event to do some stuff when a user clicks a

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.