首页 \ 问答 \ 装载没有显示在框内(loading not showing within the box)

装载没有显示在框内(loading not showing within the box)

在ajax调用期间,我使用jquery和css显示带有灰色背景的加载器。 问题是我需要加载器和灰色背景只能在如下所示的框中可见,并在中心加载文本和图标

在此处输入图像描述

我的代码工作正常,但灰色背景的加载器显示整个页面,如下所示。

在此处输入图像描述

任何人都可以告诉我一些解决方案

我的代码如下所示

的jsfiddle

    ajaxindicatorstart('loading data.. please wait..');

    function ajaxindicatorstop()
    {
        $('#resultLoading .bg').height('100%');
        $('#resultLoading').fadeOut(300);
        $('.myBox').css('cursor', 'default');
    }

    function ajaxindicatorstart(text)
    {
        if($('.myBox').find('#resultLoading').attr('id') != 'resultLoading'){
            $('.myBox').append('<div id="resultLoading" style="display:none"><div><img src="http://w3lessons.info/demo/ajax-indicator/ajax-loader.gif"><div>'+text+'</div></div><div class="bg"></div></div>');
        }

        $('#resultLoading').css({
            'width':'100%',
            'height':'100%',
            'position':'fixed',
            'z-index':'10000000',
            'top':'0',
            'left':'0',
            'right':'0',
            'bottom':'0',
            'margin':'auto'
        });

        $('#resultLoading .bg').css({
            'background':'#000000',
            'opacity':'0.7',
            'width':'100%',
            'height':'100%',
            'position':'absolute',
            'top':'0'
        });

        $('#resultLoading>div:first').css({
            'width': '250px',
            'height':'75px',
            'text-align': 'center',
            'position': 'fixed',
            'top':'0',
            'left':'0',
            'right':'0',
            'bottom':'0',
            'margin':'auto',
            'font-size':'16px',
            'z-index':'10',
            'color':'#ffffff'

        });

        $('#resultLoading .bg').height('100%');
           $('#resultLoading').fadeIn(300);
        $('.myBox').css('cursor', 'wait');
    }

I have used jquery and css to show a loader with gray background during an ajax call. The thing is I need the loader and the gray background to be visible only within a box like as shown below with loading text and icon in center

enter image description here

My code is working fine but the loader with gray background is showing for the full page like as shown below.

enter image description here

Can anyone please tell me some solution for this

My code is as given below

JSFiddle

    ajaxindicatorstart('loading data.. please wait..');

    function ajaxindicatorstop()
    {
        $('#resultLoading .bg').height('100%');
        $('#resultLoading').fadeOut(300);
        $('.myBox').css('cursor', 'default');
    }

    function ajaxindicatorstart(text)
    {
        if($('.myBox').find('#resultLoading').attr('id') != 'resultLoading'){
            $('.myBox').append('<div id="resultLoading" style="display:none"><div><img src="http://w3lessons.info/demo/ajax-indicator/ajax-loader.gif"><div>'+text+'</div></div><div class="bg"></div></div>');
        }

        $('#resultLoading').css({
            'width':'100%',
            'height':'100%',
            'position':'fixed',
            'z-index':'10000000',
            'top':'0',
            'left':'0',
            'right':'0',
            'bottom':'0',
            'margin':'auto'
        });

        $('#resultLoading .bg').css({
            'background':'#000000',
            'opacity':'0.7',
            'width':'100%',
            'height':'100%',
            'position':'absolute',
            'top':'0'
        });

        $('#resultLoading>div:first').css({
            'width': '250px',
            'height':'75px',
            'text-align': 'center',
            'position': 'fixed',
            'top':'0',
            'left':'0',
            'right':'0',
            'bottom':'0',
            'margin':'auto',
            'font-size':'16px',
            'z-index':'10',
            'color':'#ffffff'

        });

        $('#resultLoading .bg').height('100%');
           $('#resultLoading').fadeIn(300);
        $('.myBox').css('cursor', 'wait');
    }

原文:https://stackoverflow.com/questions/37437842
更新时间:2022-01-16 10:01

最满意答案

将_GetCommandLineA更改为_GetCommandLine * W * CommandLineToArgv需要指向UNICODE字符串的指针。

MASM但差不多:

start:
    push    ebp
    mov     ebp, esp
    sub     esp, 4

    call    GetCommandLineW

    lea     ecx, dword ptr[ebp - 4] ; need the address of local
    push    ecx                     ; address of local
    push    eax                     ; pointer to unicode string
    call    CommandLineToArgvW

    push    dword ptr [ebp - 4]     ; value of local
    push    offset Format
    call    crt_printf
    add     esp, 8

    ; this is all?  Then we don't have to restore stack.
    push    0
    call    ExitProcess
end start

这是输出:

D:\ Projects> ConTest.exe boo boo我见到你了

6

d:\项目>


Change _GetCommandLineA to _GetCommandLine*W* CommandLineToArgv expects a pointer to a UNICODE string.

MASM but just about the same:

start:
    push    ebp
    mov     ebp, esp
    sub     esp, 4

    call    GetCommandLineW

    lea     ecx, dword ptr[ebp - 4] ; need the address of local
    push    ecx                     ; address of local
    push    eax                     ; pointer to unicode string
    call    CommandLineToArgvW

    push    dword ptr [ebp - 4]     ; value of local
    push    offset Format
    call    crt_printf
    add     esp, 8

    ; this is all?  Then we don't have to restore stack.
    push    0
    call    ExitProcess
end start

and this is the output:

D:\Projects>ConTest.exe boo boo I see you

6

D:\Projects>

相关问答

更多
  • 如果您可以将RDP应用到实例,那么您可以像使用本地计算机一样使用fusion日志查看器。 只需将以下两个文件复制到Azure实例即可。 FUSLOGVW.exe flogvwrc.dll 这些文件可以在你的本地机器上找到(如果你已经安装了windows SDK): C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v8.0A \ bin \ NETFX 4.0 Tools \ 1033 显然,该路径的某些部分将取决于您的Windows和.net版本。 正如 ...
  • 堆栈主要由CPU来维护(PUSH / POP / CALL / RET命令); 该堆纯粹是一个OS /运行时库功能。 因此,堆叠访问是很自然的。 对于堆访问,您只需从汇编代码(HeapAlloc / HeapFree或其他库)中调用相关的API即可。 与堆栈不同,汇编语言中没有用于堆内存管理的低级原语。 您不必担心Windows上的堆栈大小。 随着您越来越多地使用它,它会变得透明。 在低级方面,Windows在堆栈底部下方设置了一个守卫内存页面(假设堆栈增长缓慢)。 当堆栈到达警戒页面时,会在CPU中生成访 ...
  • 要获取程序集的全名,可以使用以下代码(如Romasz所述)。 this.GetType().GetTypeInfo().Assembly.FullName 在UWP中,提交给商店的所有应用程序都将遵循.NET Native。 .NET Native运行时不包含JIT编译器。 因此,必须提前生成所有必需的本机代码。 一组启发式方法用于确定应生成哪些代码,但这些启发式方法无法涵盖所有可能的元编程方案。 有关更多信息,请参阅文章Reflection和.NET Native 。 在您的情况下,我建议您使用资源文件 ...
  • 将_GetCommandLineA更改为_GetCommandLine * W * CommandLineToArgv需要指向UNICODE字符串的指针。 MASM但差不多: start: push ebp mov ebp, esp sub esp, 4 call GetCommandLineW lea ecx, dword ptr[ebp - 4] ; need the address of local push ...
  • 看起来dll位于不同的文件夹中。 C:\ WINDOWS \ Microsoft.NET \装配\ GAC_32 \ Oracle.DataAccess \ v4.0_4.112.3.0__89b483f429c47342 \ oracle.dataaccess.dll Looks like the dll was in a different folder. C:\Windows\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\v4.0_4.112.3.0_ ...
  • GNU / Linux由免费软件构成 , bash是免费软件,因此您可以获取源代码并对其进行改进(并且您应该根据GPL许可证发布改进的补丁)。 但是没有公共库这样做,因为shell的作用是将命令行扩展为execve(2)系统调用的参数(然后转到调用程序的main )。 (这在MS-DOS中是不同的,被调用的程序必须扩展其命令行) 函数wordexp(3)接近你想要的。 您可能想要研究更简单的shell的源代码,例如下载sash-3.7.tar.gz GNU/Linux is made of free sof ...
  • CommandLineToArgvW至少有三个怪癖需要注意: 结果是一个指向宽字符串的指针数组。 MASM32函数crt_printf使用Microsoft VC运行时库(msvcrt.dll)中的函数printf 。 因此,您可以使用大写的“S”作为类型字段字符。 看一下MSDN上的printf Type Field Characters 。 结果是指向字符串的指针数组的第一个元素的地址。 大多数打印函数都需要指向字符串的指针,而不是指向字符串指针的指针。 您必须取消引用该地址才能获得指向该字符串的指针。 ...
  • 程序集Microsoft.Threading.Tasks有Microsoft.Progress类,它实现了IProgress 。 它是Microsoft.Bcl.Async包的一部分。 There is the Microsoft.Progress class in assembly Microsoft.Threading.Tasks, which implements IProgress. It is part of the Microsoft.Bcl.Async package. ...
  • 听起来更像是你想写一个设备驱动程序? 如果是这样,请从Microsoft下载Windows驱动程序工具包 。 如果您愿意,可以使用它来编写驱动程序。 请注意,这不是一项微不足道的任务。 对您来说可能更好的想法是安装Windows7附带的WinXP虚拟机功能,或者在旧机器上安装WinXP / 98/95,然后对其进行编码。 在这些操作系统下,驱动程序模型更简单,如果需要,您可以直接轻松访问中断和/或轻松将自己提升到Ring 0。 It sounds more like you want to write a ...
  • 这是一个DOS汇编程序。 对INT 21的调用给出了这一点。 您可以在Linux上组装它,但是您将无法将其链接到DOS可执行文件中,并且无法对其进行测试。 你需要DOS。 幸运的是,您可以在Ubuntu上安装DOSBOX并使用它。 https://help.ubuntu.com/community/DOSBox 然后,你需要得到NASM,它在DOS下工作并安装它http://www.nasm.us/doc/nasmdoc1.html#section-1.3.1 然后得到ALINK,它也支持DOS http: ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)