0
I’m using this script Jasny-bootstrap.js, in that code snippet
<head>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/css/jasny-bootstrap.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/js/jasny-bootstrap.js"></script>
</head><body>
<div class="container col-md-6 fileinput fileinput-new" data-provides="fileinput" id="btnImagem">
<div class="col-md-6" style="padding-top: 45px;">
<span class="btn btn-info btn-file"><span>Imagem</span>
<input type="file" />
</span>
</div>
<div class="col-md-6" id="imagem" style="padding-top: 35px;">
<span class="fileinput-preview" style="max-height: 68px;"></span>
</div>
</div>
</body>
The problem is that in Chrome the image that is inserted gets max-height = 68px, and when I go in Firefox the image does not get max-lenght. (Does not resize and should resize as in Chrome)
How to solve this little problem?
I’m getting the impression that this section of js does not run in Firefox
if (preview.css('max-height') != 'none') $img.css('max-height', parseInt(preview.css('max-height'), 10) - parseInt(preview.css('padding-top'), 10) - parseInt(preview.css('padding-bottom'), 10) - parseInt(preview.css('border-top'), 10) - parseInt(preview.css('border-bottom'), 10))
Some solution?
Everything seems to be all right here...
– Jorge B.
@Jorgeb. vc ran on Chrome and Firefox?
– Tiago Ferezin
Both of us and it worked...
– Jorge B.
so it is my firefox, but how to treat this so that it does not occur in the client to have these errors? type in Chrome the image is resized correctly and in firefox not, how to treat you know? @Jorgeb. could help me?
– Tiago Ferezin
after all does not work in firefox...
– Jorge B.
the issue is that in Firefox the image does not resize, not arrow the
max-height
on the tag<img>
which is generated by Jasny, @Jorgeb.– Tiago Ferezin