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 January 17th 2014, 4:36 pm

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.

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 January 17th 2014, 4:48 pm

Hello PixX,

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

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax loading script problem

Post by Cesar on January 17th 2014, 4:51 pm

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;
        }

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 January 17th 2014, 4:56 pm

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);

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax loading script problem

Post by Cesar on January 17th 2014, 5:02 pm

Nothing changed to me  

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 January 17th 2014, 5:04 pm

Could you post your forum that has this active ?

Thanks Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax loading script problem

Post by Cesar on January 17th 2014, 5:06 pm

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

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 January 17th 2014, 5:11 pm

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

Your header z-index is higher than your loading bar.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Ajax loading script problem

Post by Cesar on January 17th 2014, 5:15 pm

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

 Thank you again!  huhohi

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 January 17th 2014, 5:17 pm

You're very welcome Mr. Green

Topic solved and archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

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