Does anyone know of a way to simulate a " min-top
" in an element? Maybe using JS or Jquery ...
I'm using scale()
in an object, but the function causes the element to change position.
I would like that when I apply scale()
the object always stays below that absolute position element ... Could it be?
<style type="text/css">
.papel {width: 297mm;height: 210mm; background-color:#CCC;border: 3px solid gray;top: -45%;left: 0%;position: absolute; overflow:hidden;transform:scale(0.5) translate3d(0px,0px,0px); margin-bottom: 80px;transform: translate3d(73px,521px,0px);}
.mover{position:absolute; cursor:move;}
#menu{width:100%;height:150px;background-color:blue;}
</style>
<div id="range-input">
<input type="range" id="zoompapel" min="0.1" max="1" step="0.1" />
</div>
<div id="menu">
MENU SUPERIOR
</div>
<div class="papel mover" id="papel">
TESTE
</div>
<script src="js/jquery-1.10.2.js"></script>
<script type="text/javascript">
$('#zoompapel').change(function(event) {
var value = $('#zoompapel').val();
$('#papel').css({
'-webkit-transform' : 'scale(' + value + ')',
'-moz-transform' : 'scale(' + value + ')',
'-ms-transform' : 'scale(' + value + ')',
'-o-transform' : 'scale(' + value + ')',
'transform' : 'scale(' + value + ')'});
$("#papel").css('position','absolute');
});
</script>