Instead of hide()
, use:
css('visibility','hidden')
hide()
sets the display
style to none
, which completely removes the element from the document flow and causes it to not take up space.
visibility:hidden
keeps the space as it is.
More Related Contents:
- How to change the element of another div by clicking and hovering on an element of a different div
- Hide/Show div on specific page with jquery
- HTML nchor Tag doesn’t show link
- Use jQuery to hide a DIV when the user clicks outside of it
- Clear form fields with jQuery
- How to detect if two divs touch with jquery?
- Scroll to bottom of Div on page load (jQuery)
- jQuery find closest previous sibling with class
- How to detect input type=file “change” for the same file?
- JavaScript: Changing src-attribute of a embed-tag
- How do I get the entire page’s HTML with jQuery?
- How to use jQuery to add form elements dynamically
- Get the value of -webkit-transform of an element with jquery
- Auto-click button element on page load using jQuery
- Display XML content in HTML page
- jQuery get selected option value (not the text, but the attribute ‘value’)
- jQuery checkbox event handling
- Draggable div without jQuery UI
- How to force an HTML form to validate without submitting it via jQuery
- Trying to make multiple background images cycle through a slideshow with CSS and JQUERY
- Jquery Multiple load in a DIV
- submit disabled fields
- What’s faster for including scripts, using CDN (Google) or storing them locally in website’s root?
- JQuery search in static HTML page with highlighting of found word
- Disable select options based on value *through the HTML only!*
- Selectable optgroup using select2
- Html5 drag and drop on svg element
- Possible to have a floating horizontal scrollbar?
- change the href of a css link via jquery
- Can jQuery selectors be used with DOM mutation observers?