我有一个注册页面。当我完成注册并单击“保存”按钮后,我会收到“注册成功”通知。我正在使用bigbox.css和humane.js作为我的通知。我很容易收到通知,但问题是通知有默认的高度和宽度。我该如何定制它的高度和怀疑?
var ratPack = $.sammy(function() {
this.post('#/cart', function() {
var firstname = this.params['firstName'];
var lastname = this.params['lastName'];
var organisation = this.params['organisation'];
var email = this.params['email'];
var password = this.params['password'];
var confirmPassword = this.params['confirmPassword'];
var baseurl = this.params['url'];
$.ajax({
type : 'POST',
url :'/costing-
tool/api/registration/'+firstname+'/'+lastname+'/'+email,
success : function() {
document.getElementById('light').style.display='none';
document.getElementById('fade').style.display='none';
humane.log("Registration Successful");//humane used here
},
error:function(){
alert($('#emailError'));
$('#emailError').text("This E-Mail is already registered")
}
});
});
});
bigbox.css
html,
body {
min-height: 100%;
}
.humane,
.humane-bigbox {
position: fixed;
-moz-transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
z-index: 100000;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
}
.humane,
.humane-bigbox {
font-family: Ubuntu, Verdana, sans-serif;
line-height: 40px;
font-size: 20px;
top: 25%;
left: 25%;
opacity: 0;
width: 50%;
min-height: 40px;
padding: 30px;
text-align: center;
background-image:
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1
AAAABmJLR0QA/wD/AP+gvaeTAAAAc0lEQVQokb2RQQ6EMAwDx/7/n80BtIEC3RYh
LlXrVLGTAYiBWBIGtkPSP01SfreTVoV5re9Rcee1scwDk9NurbR6
2sZJcpzy9O+2X5KsXabyPaQFYNuvkqkRviDTp9Vs8opC0TpkHvJtVjeReW/
5kEyX1gKeLEKE9peeWAAAAABJRU5ErkJggg==');
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #000),
color-stop(1, rgba(0,0,0,0.9))) no-repeat;
background: -moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat;
background: -webkit-linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat;
background: -ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat;
background: -o-linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat;
background: linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat;
*background-color: #000;
color: #fff;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
text-shadow: 0 -1px 1px #ddd;
-moz-box-shadow: 0 15px 15px -15px #000;
-webkit-box-shadow: 0 15px 15px -15px #000;
box-shadow: 0 15px 15px -15px #000;
-moz-transform: scale(0.1);
-webkit-transform: scale(0.1);
-ms-transform: scale(0.1);
-o-transform: scale(0.1);
transform: scale(0.1);
}
.humane p,
.humane-bigbox p,
.humane ul,
.humane-bigbox ul {
margin: 0;
padding: 0;
}
.humane ul,
.humane-bigbox ul {
list-style: none;
}
.humane.humane-bigbox-info,
.humane-bigbox.humane-bigbox-info {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
EAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAQElEQVQokW
NgYEj5z8TAwPCfiYGBgQGVIEKMTG2DTYwRVez/IHIaNcUGyBnYg
pORel6gpvFEJhBqpxIaG8/AAADsKDq/HhYQ2AAAAABJRU5ErkJggg==');
background: -webkit-gradient(linear, left top,
left bottom, color-stop(0, #000064), color-stop(1, rgba(0,0,100,0.9))) no-
repeat;
background: -moz-linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-
repeat;
background: -webkit-linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-
repeat;
background: -ms-linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-
repeat;
background: -o-linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-repeat;
background: linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-repeat;
*background-color: #030;
}
.humane.humane-bigbox-success,
humane-bigbox.humane-bigbox-success {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUg
AAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAP
klEQVQokWNgSGH4z8TAACEYUAkixMjUNsjEGFHF/g8ip1FVbGC
cgS04GannBaoaT1wCwWkvmXbQ2HgGBgYA8Yw6v+m4Kh8AAAAASUVORK5CYII=');
background: -webkit-gradient(linear, left top,
left bottom, color-stop(0, #006400), color-stop(1, rgba(0,100,0,0.9))) no-
repeat;
background: -moz-linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-
repeat;
background: -webkit-linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-
repeat;
background: -ms-linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-repeat;
background: -o-linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-repeat;
background: linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-repeat;
*background-color: #030;
}
.humane.humane-bigbox-error,
.humane-bigbox.humane-bigbox-error {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA
AEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAA
AAPklEQVQokWNIYWD4z8QAJRhQCSLEyNQ2uMQYUcX+DyKnUVd
sQJyBLTgZqecF6hpPVALBaS+ZdtDYeAYGBgYA9vA6v4OR3MkAAAAASUVORK5CYII=');
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #640000),
color-stop(1, rgba(100,0,0,0.9))) no-repeat;
background: -moz-linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-
repeat;
background: -webkit-linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-
repeat;
background: -ms-linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%)
no-repeat;
background: -o-linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-repeat;
background: linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-repeat;
*background-color: #300;
}
.humane.humane-animate,
.humane-bigbox.humane-bigbox-animate {
opacity: 1;
-moz-transform: scale(1);
-webkit-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
}
.humane.humane-animate:hover,
.humane-bigbox.humane-bigbox-animate:hover {
opacity: 0.6;
-moz-transform: scale(0.8);
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
-o-transform: scale(0.8);
transform: scale(0.8);
}
.humane.humane-js-animate,
.humane-bigbox.humane-bigbox-js-animate {
opacity: 1;
-moz-transform: scale(1);
-webkit-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
}
.humane.humane-js-animate:hover,
.humane-bigbox.humane-bigbox-js-animate:hover {
opacity: 0.6;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
}
答案 0 :(得分:2)
我发现你对CSS非常陌生,但你可以改变bigbox宽度,它是父元素宽度的50%。关于bigbox高度,默认情况下设置为auto(这就是你现在没有看到它的原因)并且你将min-height设置为40px,以防你在bigbox中没有列表或文本。
.humane-bigbox {
font-family: Ubuntu, Verdana, sans-serif;
line-height: 40px;
font-size: 20px;
top: 25%;
left: 25%;
opacity: 0;
width: 50%; <- This is the width value
min-height: 40px;
...
}
答案 1 :(得分:0)
请参阅您的行代码:
humane.log("Registration Successful");//humane used here
改变这个:
humane.log("Registration Successful").css('width',
'WRITE WIDTH').css('height','WRITE Height');//humane used here
希望它有效...... 祝你好运