The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Ajax loading script problem

View previous topic View next topic Go down

Solved Ajax loading script problem

Post by Cesar on Fri Jan 17 2014, 17:36

I have found this code , but is only working if i enable the FM toolbar . But i want this to work when the toolbar is disabled , what is wrong?

 Javascript code:
Code:
jQuery(function() {
              jQuery('body').prepend('<div id="ajax_loading" style=""><img src="http://i58.servimg.com/u/f58/17/89/00/23/ajax_l10.gif" alt="Loading..."></div>');
              jQuery('a').click(function() {
                  jQuery('#ajax_loading').slideDown();
                  setTimeout('load()', 1000);
              });
            });
            function load() {
              jQuery('#ajax_loading').slideUp('1000');
            }
            setTimeout('load()', 1000);

The CSS code i don't think is so important , i belive the problem is in the JS code.
avatar
Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: Ajax loading script problem

Post by Ange Tuteur on Fri Jan 17 2014, 17:48

Hello PixX,

I tested the script and it is working fine, with and without the toolbar. What is the CSS you're using ?
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2879
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax loading script problem

Post by Cesar on Fri Jan 17 2014, 17:51

Hmm , maybe the problem is my header. He "follow" me when i scroll down.. Anyway , the CSS code:
 
Code:
#ajax_loading {
            background: url("http://i58.servimg.com/u/f58/16/18/26/07/ajaxlo10.png") repeat-x scroll 0px 0px transparent;
            border: 1px solid rgb(56, 77, 37);
            border-radius: 0px 0px 5px 5px;
            box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2), 0px -1px 0px rgba(255, 255, 255, 0.2) inset;
            color: rgb(255, 255, 255);
            left: 46%;
            padding: 5px 0px 8px;
            position: fixed;
            text-align: center;
            top: 0px;
            width: 8%;
            z-index: 999;
        }
avatar
Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: Ajax loading script problem

Post by Ange Tuteur on Fri Jan 17 2014, 17:56

Yep, still displaying fine Mr. Green

Try setting the z-index on the element in the script since you cannot exceed 999 z-index in the stylesheet.

( I already set it for you )
Code:
jQuery(function() {
                  jQuery('body').prepend('<div id="ajax_loading" style="z-index:99999;"><img src="http://i58.servimg.com/u/f58/17/89/00/23/ajax_l10.gif" alt="Loading..."></div>');
                  jQuery('a').click(function() {
                      jQuery('#ajax_loading').slideDown();
                      setTimeout('load()', 1000);
                  });
                });
                function load() {
                  jQuery('#ajax_loading').slideUp('1000');
                }
                setTimeout('load()', 1000);
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2879
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax loading script problem

Post by Cesar on Fri Jan 17 2014, 18:02

Nothing changed to me  
avatar
Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: Ajax loading script problem

Post by Ange Tuteur on Fri Jan 17 2014, 18:04

Could you post your forum that has this active ?

Thanks Smile
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2879
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax loading script problem

Post by Cesar on Fri Jan 17 2014, 18:06

Alright , it is under construction  drunken 
http://vontech.board.st/
avatar
Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: Ajax loading script problem

Post by Ange Tuteur on Fri Jan 17 2014, 18:11

Add this to your CSS :
Code:
#topbar { z-index:950 !important; }

Your header z-index is higher than your loading bar.
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2879
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax loading script problem

Post by Cesar on Fri Jan 17 2014, 18:15

Thank you very much Ange.You can lock this topic now.

 Thank you again!  huhohi
avatar
Cesar
Forumember

Posts : 207
Reputation : 3
Language : Romanian

http://www.wolffighterz.com/

Back to top Go down

Solved Re: Ajax loading script problem

Post by Ange Tuteur on Fri Jan 17 2014, 18:17

You're very welcome Mr. Green

Topic solved and archived
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2879
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum