jqGrid&自定义加载Gif

时间:2012-02-01 15:34:55

标签: jquery jqgrid

希望有人可以帮忙!我已经examples和其他人查看了几个Oleg

我正在尝试在jqGrid上创建一个加载gif显示,同时从数据库中提取数据。

JS

function submitSearchForm() {
var newimgsrc = $('.loading').css("background-image");
$('.loading').css({ "background-image": newimgsrc });
$('.loading').css({ "display": "block" });
$.cookie("formState", $('#conform').serialize());
$('#conform').submit();
}

CSS

.ui-jqgrid .loading {opacity: .6; filter:Alpha(Opacity=60);background:#fff        
url(../images/Loader.gif) no-repeat 50% 50%;position: absolute; 
top:0;left:0;right:0;bottom:0;width: 100%;z-index:999999;padding: 0; margin: 0;text-
align: center;font-weight: bold;display: none;border-width: 0px !important;}

我的问题是如何让图片显示,而是如何让它旋转?

感谢任何帮助,如果这是重复的话。请给我一个解决方案的链接并关闭问题。

由于

1 个答案:

答案 0 :(得分:0)

以下代码应为您想要实现的目标提供基础

<html> 
<head>   
  <script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
  <style>
.loading 
{
    background:#fff url('http://www.jqueryin.com/demo/spinner/spinner.gif') no-repeat 50% 50%;
    display: none;
    height: 16px;
    width: 16px;
} 
  </style>
</head> 
<body> 

<div class="loading"></div>
<div id="spinIt">spin it</div>
<div id="stopIt">stop it</div>

<script type="text/javascript">   
$('#spinIt').click(function() {
    $('.loading').css({ "display": "block" }); 
});

$('#stopIt').click(function() {
    $('.loading').css({ "display": "none" }); 
});
</script> 
</body> 
</html>
相关问题