[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

ajax loading content

grzessiek

12/13/2014 7:15:00 PM

hey,

I load HTML using jquery .load().

In this HTML loaded, I have a div with scroll (CSS overflow: auto).

Below that div I have a simple piece of code.

Why it does not work:

$(document).ready(function(){
$('#ajaxLoadedDiv').scrollTop(100);
});

and it works:

$(document).ready(function(){
$('#ajaxLoadedDiv').html('some content');
});

Thanks,
g.
2 Answers

Evertjan.

12/13/2014 7:51:00 PM

0

grzessiek <grzesiek76@poczta.onet.pl> wrote on 13 dec 2014 in
comp.lang.javascript:

> hey,
>
> I load HTML using jquery .load().

Oh please, this NG is about Javascript proper,
please go elsewhere for this jquery crap.


> In this HTML loaded, I have a div with scroll (CSS overflow: auto).
>
> Below that div I have a simple piece of code.
>
> Why it does not work:
>
> $(document).ready(function(){
> $('#ajaxLoadedDiv').scrollTop(100);
>});
>
> and it works:
>
> $(document).ready(function(){
> $('#ajaxLoadedDiv').html('some content');
>});
>
> Thanks,
> g.
>



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

JJ

12/13/2014 10:38:00 PM

0

On Sat, 13 Dec 2014 20:15:06 +0100, grzessiek wrote:
> hey,
>
> I load HTML using jquery .load().
>
> In this HTML loaded, I have a div with scroll (CSS overflow: auto).
>
> Below that div I have a simple piece of code.
>
> Why it does not work:
>
> $(document).ready(function(){
> $('#ajaxLoadedDiv').scrollTop(100);
> });

Because there's no content.

> and it works:
>
> $(document).ready(function(){
> $('#ajaxLoadedDiv').html('some content');
> });

Because you put a content.