How to remove height and width?
To make it work from all ways, you need to remove both attribute and css. This is work on my code.
$('your-image')
.removeAttr("width").removeAttr("height")
.css({ width: "", height: "" });
This is a VERY simple solution with jQuery. I found the answer at wpwizard.net.
Here's the URL: http://wpwizard.net/jquery/remove-img-height-and-width-with-jquery/
Here's the jQuery:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($){
$('img').each(function(){
$(this).removeAttr('width')
$(this).removeAttr('height');
});
});
</script>
Try to use this code:
$('your-image').css({
width: '',
height: ''
});
If you want to set the "original" image dimensions try this:
$('your-image').css({
width: 'auto',
height: 'auto'
});