beemo
Members
-
Joined
-
Last visited
Reputation Activity
-
beemo got a reaction from Kaskhautual in Text ValidationI know that I should be trying to contribute more but I was just wondering if someone could help me know why I am not able validate data correctly. Basically what's happening is that it's validated the input before I've actually entered any type of data, how do I remove that style effect: http://jsfiddle.net/xepDX/
-
beemo reacted to Chris Day in Website Alignmentive just noticed my JQuery code is incorrect it should be
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
// Will add the margin on page load
$(document).ready( function() {
$('#form_container').css('margin-top', (($(window).height()/2)-($('#form_container').height()/2))+'px');
});
// Will redo the margin on window resize
$(window).resize( function() {
$('#form_container').css('margin-top', (($(window).height()/2)-($('#form_container').height()/2))+'px');
});
</script> -
beemo reacted to teodora in Website AlignmentHi
One solution is to give your div #form_container a fixed height and width and position:absolute;
Then you can center it horizontally and vertically using negative margins:
#form_container { background:#fff; text-align:left; position:absolute; width:640px; height:500px; left:50%; top:50%; margin-left:-320px; margin-top:-250px; } This is not ideal because you need to specify fixed width and height and it wouldn't work with dynamic width and height.
Hope that helps a bit
-
beemo reacted to Chris Day in Website Alignmentyou can use JS to add a margin-top to the element in the example below i used JQuery
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready( function() { $('#form_container').css('margin-top', ($('#form_container').height()/2)+'px'); }); </script>
or if you knew the container was always going to be 484px you could use pure css
#form_container { position:absolute; left: 320px; right: 0; top: 242px; bottom: 0; } edit: teodora beat me to it was testing a way to do it in css3 using calc but failed