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.

Display loading img and drop down about this ajax code

View previous topic View next topic Go down

Display loading img and drop down about this ajax code

Post by Ahmed.K on October 11th 2013, 12:03 am

Is it possible to display loading img for this code?


Code:
$(document).ready(function () {
    $('#pun-visit-home').each(function () {
        var loop = $(this);
        loop.append('<div class="Topic1"><p class="postx"></p><div class="Post1" id="blog_comments"><span class="rpost"></span></div></div>')
    });
    $('.Post1').hide();
    $('.Postx').click(function () {
        $('.Post1').fadeOut(100);
        $(this).parent().find('div').stop().fadeToggle('slow');
        var url = $(this).parentsUntil('.recent_topics').find('.recent_topics a:first').attr('href');
        $.get(url, function (data) {
            var post = $('div.post', data).html();
            $('.rpost').html(post);
        });
    })
});
This code to get the last post from the recent topics in the homepage.

and the last post containing drop down system, but this doesn't work with the last post in the homepage. any ideas?

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Ahmed.K on October 12th 2013, 12:32 am

No Javascript experts here??

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Ange Tuteur on October 12th 2013, 4:39 am

I am only capable with CSS/HTML, but I can try to help you.

Firstly what is your forum version: phpbb2, phpbb3, punbb, or invision?

Secondly can you provide us with more information as to what you're trying to do, a screenshot maybe?

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Ahmed.K on October 12th 2013, 10:11 am

As i said above, I use this code in the Homepage to get the last post.

PunBB.

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by levy on October 12th 2013, 2:14 pm

Please provide us your forum URL becuase I'm little bit confuse What the fuck ?!?
I don't find in my testing forum any #pun-visit-home

levy
Hyperactive

Male Posts : 2582
Reputation : 345
Language : Romanian, English
Location : criticize artwork, not people!

http://help.forumotion.com/

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Ahmed.K on October 12th 2013, 2:33 pm

this is a new div i made it. and the id name its not important, you can add any name. the id name is not related to adding loading img for this ajax code.

Guys, my question is just to Javascript experts (if there).

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by SLGray on October 12th 2013, 10:15 pm

Please post your forum's link.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36697
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Ahmed.K on October 12th 2013, 11:34 pm


Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Ahmed.K on October 13th 2013, 10:42 pm

OMG, is this too difficult??

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Ange Tuteur on October 14th 2013, 7:16 am

@Ahmed.K wrote:OMG, is this too difficult??
Well not all of us are capable of JavaScript, but we're trying to help you as best we can. Anyhow when you mean loading image, are you talking about something similar to this?


Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Ahmed.K on October 14th 2013, 12:02 pm

for example, like this one

Ahmed.K
Forumember

Posts : 349
Reputation : 4
Language : English

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by middo2 on October 14th 2013, 6:18 pm

SethC1995 wrote:
@Ahmed.K wrote:OMG, is this too difficult??
Well not all of us are capable of JavaScript, but we're trying to help you as best we can. Anyhow when you mean loading image, are you talking about something similar to this?

Could I have the code for that?

middo2
Forumember

Posts : 503
Reputation : 5
Language : English

http://newhorizons.englishboard.net

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by luiz187 on October 15th 2013, 3:44 am

i wish i had the code for that too

luiz187
Forumember

Male Posts : 183
Reputation : 3
Language : English and Portuguese and some Spanish
Location : ISS

http://everyonesblog.net

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Chromo on October 15th 2013, 3:49 am

Result for searching:
click here

Chromo
Forumember

Male Posts : 122
Reputation : 19
Language : said the Captain

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by middo2 on October 15th 2013, 4:41 am

xKillerZone31 wrote:Result for searching:
click here
The loading image that it gives is different:

And it's in the exact middle of the page, which is kind of annoying.

middo2
Forumember

Posts : 503
Reputation : 5
Language : English

http://newhorizons.englishboard.net

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by Chromo on October 15th 2013, 6:02 am

@middo2 wrote:
xKillerZone31 wrote:Result for searching:
click here
The loading image that it gives is different:

And it's in the exact middle of the page, which is kind of annoying.
Well If you really want it, so result for searching: click here

Chromo
Forumember

Male Posts : 122
Reputation : 19
Language : said the Captain

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by middo2 on October 15th 2013, 6:56 am

Aww Sad it doesnt go over the toolbar, so you cant even see it.

middo2
Forumember

Posts : 503
Reputation : 5
Language : English

http://newhorizons.englishboard.net

Back to top Go down

Re: Display loading img and drop down about this ajax code

Post by levy on October 15th 2013, 10:14 am

Ahmed , I've have an old code about that ( loading ) check him :

Code:
document.write('
<div id="ajax_loading"><img src="http://iceimg.com/i/b7/8a/d8025681cd.gif" alt="Loading..."></div>');
window.onload=function(){$("#ajax_loading").fadeOut(1500);};
document.write('<style>#ajax_loading {
background: #1579C7;
background: -moz-linear-gradient(top,#158EC7 0%,#0D4AA6 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#1572C7),color-stop(100%,#0D69A6));
background: linear-gradient(top,#1579C7 0%,#0D69A6 100%);
border: 1px solid#0D38A6;
color: #fff;
text-align: center;
padding: 5px 0 8px;
width: 8%;
top: 0px;
left: 46%;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
border-radius: 0 0 5px 5px;
z-index: 10000;
border-top: none;
position: fixed;
-moz-box-shadow: 0px 3px 5px rgba(0,0,0,0.2),inset 0px-1px 0px rgba(255,255,255,0.2);
-webkit-box-shadow: 0px 3px 5px rgba(0,0,0,0.2),inset 0px-1px 0px rgba(255,255,255,0.2);
box-shadow: 0px 3px 5px rgba(0,0,0,0.2) , inset 0px-1px 0px rgba(255,255,255,0.2);
}</style>');

levy
Hyperactive

Male Posts : 2582
Reputation : 345
Language : Romanian, English
Location : criticize artwork, not people!

http://help.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