It has come to my attention that Firefox (specifically v19.0.2) is encountering an issue with the jQuery css() function when attempting to retrieve an element's padding
.
While using .css('padding-left')
seems to be a workaround, it would be more convenient to accomplish this task in a single line rather than calling four separate functions.
In order to illustrate the problem, I have provided a sample for comparison of Chrome and Firefox behaviors:
$('#log').append( 'padding : '+ $('#sample').css('padding')+'\n'+ 'padding-top : '+ $('#sample').css('padding-top')+'\n'+
'padding-bottom : '+ $('#sample').css('padding-bottom')+'\n'+ 'padding-left : '+ $('#sample').css('padding-left')+'\n'+
'padding-right : '+ $('#sample').css('padding-right')+'\n' );
#sample {
border: 1px solid black;
padding: 8px;
margin: 10px;
}
#log {
padding: 8px;
margin: 10px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div id="sample">Lorem ipsum</div>
<textarea id="log" rows="10" cols="50"></textarea>
Is there a solution or workaround for retrieving an element's padding
without having to call multiple functions? Any insights or suggestions would be greatly appreciated.
Thank you.