我想要调整提交表单时显示的“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>要更改noty消息的外观,我编辑了两个文件:
首先,我在文件中增加了中心布局media/noty/ layout /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
},其次,我更正了media/noty/themes/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中有效,但在Chome中不起作用,即在Firefox中提交时,我会看到一个大的可读字体的大窗口,而在Chrome中提交时,我会看到默认的小字体。
请建议一个解决方法,即我希望它在两个浏览器中以相同的方式工作。
发布于 2017-02-15 22:01:37
好了,我知道是怎么回事了-- google-chrome没有从自己的本地缓存中获取任何设置。这就是为什么我在服务器上对文件的操作没有在Chrome浏览器中做任何改变。清理缓存(History -> clear -> Cached data)对我来说很有效--现在我可以看到对我的站点所做的更改。
https://stackoverflow.com/questions/42244412
复制相似问题