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中提交時查看默認的小字體。
請建議一種解決方法,即我希望它在兩個瀏覽器中以相同的方式工作。