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...
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...
You need to use page load even (in Events tab).
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.
Hi Ellen,
Yes you can use following JS code on event you need:
pre
document.body.scrollTop = 100;
/pre
Regards.
I added that to a page load event and it didn't change anything.
Any error in console?
No error.
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.
Still didn't work.
Okay,
Try use it with some delay:
pre
var onDelay = function(){
Code: Select all
document.body.scrollTop = 500; };
window.setTimeout(onDelay, 1000);
/pre
Regards.