フォームが送信されたときに表示される 'noty'ウィンドウのサイズを変更したい - テキストフォントとウィンドウサイズを大きくする。FirefoxとChromeでnotyのウィンドウサイズが
「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>
は、私は2つのファイルに編集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に送信するときはデフォルトの小さなフォントを表示します。
回避策を提案してください。つまり、両方のブラウザで同じように動作させてください。