js動的設定margin
706 ワード
$(document).ready(function(){
var m1_top = (( $(window).height() - $(".login-box-body").height() )/2-$(".login-logo").height ())/2;
$(".login-logo").css({"margin": m1_top + "px auto"});
$(".login-bottom").css({"margin-top": m1_top + "px"});
// margin
window.onresize=function(){
var m1_top = (( $(window).height() - $(".login-box-body").height() )/2-$(".login-logo").height())/2;
$(".login-logo").css({"margin": m1_top + "px auto"});
$(".login-bottom").css({"margin-top": m1_top + "px"});
}
});