Page 1 of 2

page load area?

Posted: Wed Feb 13, 2013 1:16 am
by John Hajewski

where do I find this "page load" area? I am trying to center an image and i found the code on this forum... but i don't know where to enter it. .."more properties?" I don't see "load screen" in the events area...


page load area?

Posted: Wed Feb 13, 2013 5:56 am
by maxkatz

You need to use page load even (in Events tab).


page load area?

Posted: Sun Dec 07, 2014 11:28 pm
by Ellen Schlechter

Is there a way that when the page loads, it is already scrolled just a little bit. Similar to iOS apps made by apple, I want my search bar to be "under the header" when the page loads, then if a user scrolls up, they can see it.


page load area?

Posted: Mon Dec 08, 2014 5:37 am
by Yurii Orishchuk

Hi Ellen,

Yes you can use following JS code on event you need:

pre

document.body.scrollTop = 100;

/pre

Regards.


page load area?

Posted: Mon Dec 08, 2014 5:03 pm
by Ellen Schlechter

I added that to a page load event and it didn't change anything.


page load area?

Posted: Mon Dec 08, 2014 5:44 pm
by Alena Prykhodko

Any error in console?


page load area?

Posted: Mon Dec 08, 2014 6:38 pm
by Ellen Schlechter

No error.


page load area?

Posted: Tue Dec 09, 2014 5:49 am
by Yurii Orishchuk

Hi Ellen,

It's not correct to use this code on "page load" event cause of page not displayed yet. Use "page show" instead.

Regards.


page load area?

Posted: Tue Dec 09, 2014 1:51 pm
by Ellen Schlechter

Still didn't work.


page load area?

Posted: Tue Dec 09, 2014 10:24 pm
by Yurii Orishchuk

Okay,

Try use it with some delay:

pre

var onDelay = function(){

Code: Select all

document.body.scrollTop = 500; 

};
window.setTimeout(onDelay, 1000);

/pre

Regards.