0

我有一个注册页面。当我完成注册并单击保存按钮时,我会收到“注册成功”通知。我正在使用 bigbox.css 和 humane.js 作为通知。我很容易收到通知,但问题是通知有其默认的 height 和 width 。我如何自定义它的高度和重量?

   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);
     }
4

2 回答 2

2

我看到您对 CSS 非常陌生,但您可以更改为父元素宽度的 50% 的 bigbox 宽度。关于 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;
   ...
}

进一步阅读:

于 2012-12-07T11:39:06.330 回答
0

请参阅您的行代码:

humane.log("Registration Successful");//humane used here

用这个改变:

humane.log("Registration Successful").css('width',
   'WRITE WIDTH').css('height','WRITE Height');//humane used here

希望它有效....祝你好运

于 2012-12-07T10:01:49.993 回答