2017-02-15 65 views
0

我想调整窗体提交时显示的'noty'窗口大小 - 使文本字体和窗口大小更大。Firefox和Chrome中不同的窗口大小

在“noty”代码看起来是这样的:

<script> 
    $(function() 
    { 
     $('#task-form').submit(function() 
     { 
      $(this).find('.submit').val('Saving...'); 
      $.post('biomed/default/save', $('#task-form').serialize(), function(data) 
      { 
       if (data.isValid) 
       { 
        $(".btn").attr("disabled", true); 
        noty 
        ({ 
          layout:'center', 
          text:'Your task #'+data.timestamp+' has been submitted. Redirecting... ', 
          type:'success' 
        }); 
        setTimeout(function() {window.location = "biomed/progress?task_id="+data.timestamp; }, 5000);      
       } 
      .... 
     .... 
    .... 
.... 
</script> 

要更改noty消息的外观我编辑两个文件:

首先,我已经在文件增加的宽度为中心布局媒体/ noty /布局/ center.js:

container: { 
    object: '<ul id="noty_center_layout_container" />', 
    selector: 'ul#noty_center_layout_container', 
    style: function() { 
      $(this).css({ 
       width: '800px', <- HERE 

    .... 

  css: { 
        display: 'none', 
        width: '800px' <- HERE 
      }, 

第二,我已经改正了字体,媒体/ noty /主题/ default.js:

 switch (this.options.layout.name) { 
      case 'topCenter': case 'center': case 'bottomCenter': case 'inline': 
       this.$bar.css({ 
         borderRadius: '5px', 
         border: '1px solid #eee', 
         boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)" 
       }); 
    HERE ->  this.$message.css({fontSize: '32px', lineHeight: '40px', textAlign: 'center'}); 
      break; 

结果:这个工作在Firefox,但不是在丁目,即现在我看到一个大窗户,大在Firefox中提交时可读的字体,以及在Chrome中提交时查看默认的小字体。

请建议一种解决方法,即我希望它在两个浏览器中以相同的方式工作。

回答

0

好的,我知道发生了什么 - 谷歌铬从它自己的(谷歌浏览器)本地缓存采取noty设置。这就是为什么我对服务器上的文件进行的操作从未在Chrome浏览器中进行任何更改。清理缓存(历史 - >清除 - >缓存数据)为我工作 - 现在我可以看到对我的网站所做的更改。