show() making elements display:inline
I am working on some code where I am trying to make something appear depending on what is clicked. I was using slideDown() but was having issues with some jitteriness.
When I switched it over to just using show, all of a sudden instead of making things display:block, it made the elements display:inline. Anyone know why?
-
jQuery:
$('#pt-wp').click(function() {
$('#post-inputs *').hide();
$('#post_type').val(1);
$("label[for='content']").show();
$("textarea[name='content']").show();
$('button').show();
return false;
});
HTML:
<div id="post-inputs">
<input id="id" type="hidden" value="0" name="id" style="display: none;"/>
<input id="post_type" type="hidden" value="1" name="post_type" style="display: none;"/>
<input id="parent_id" type="hidden" value="" name="parent_id" style="display: none;"/>
<input id="author_id" type="hidden" value="1" name="author_id" style="display: none;"/>
<input id="recipient_id" type="hidden" value="1" name="recipient_id" style="display: none;"/>
<label for="title" style="display: none;">Title</label>
<label class="error" for="title" style="display: none;"/>
<input id="title" type="text" value="" name="title" style="display: none;"/>
<label for="content" style="display: inline;">What would you like to share?</label>
<label class="error" for="content" style="display: inline;"/>
<textarea id="content" name="content" style="display: inline;"/>
<label for="expiration_date" style="display: none;">Expiration Date</label>
<label class="error" for="expiration_date" style="display: none;"/>
<input id="expiration_date" class="datepicker hasDatepicker" type="text" value="" name="expiration_date" style="display: none;"/>
<label for="possible" style="display: none;">Points Possible</label>
<label class="error" for="possible" style="display: none;"/>
<input id="possible" type="text" value="" name="possible" style="display: none;"/>
<label for="category" style="display: none;">Assignment Category</label>
<label class="error" for="category" style="display: none;"/>
<input id="category" type="text" value="" name="category" style="display: none;"/>
<label for="due_date" style="display: none;">Due Date</label>
<label class="error" for="due_date" style="display: none;"/>
<input id="due_date" class="datepicker hasDatepicker" type="text" value="" name="due_date" style="display: none;"/>
<label for="event_date" style="display: none;">Date</label>
<label class="error" for="event_date" style="display: none;"/>
<input id="event_date" class="datepicker hasDatepicker" type="text" value="" name="event_date" style="display: none;"/>
<label for="event_time" style="display: none;">Time</label>
<label class="error" for="event_time" style="display: none;"/>
<input id="event_time" class="timepicker ui-timepickr" type="text" value="" name="event_time" style="display: none;"/>
<span class="ui-reset ui-dropslide ui-component" style="top: 22px; left: 0px; display: none;">
</span>
<label for="filename" style="display: none;">File</label>
<label class="error" for="filename" style="display: none;"/>
<input id="filename" type="file" value="" style="display: none;"/>
<label for="url" style="display: none;">URL</label>
<label class="error" for="url" style="display: none;"/>
<input id="url" type="text" value="http://" name="url" style="display: none;"/>
<input id="submit" type="hidden" value="submit" name="submit" style="display: none;"/>
<button id="send-info" value="submit" name="send-info" type="submit" style="display: inline;">Share It!</button>
</div>