So I'm currently testing out my semi-finished product, and most if not all pages longer than a single screen length are loading in the middle of or at the bottom of each page. Did I do something wrong, or is it a bug? And if I have to do some kind of workaround, is there anything I can do? It would be nice if readers began at the top of the page.
Comments
Which browser (brand/version) and OS (brand/version) are you testing the story on?
Does your story have custom CSS in it?
Would you be willing to make a copy of your story HTML file available for debugging purposes?
https://onedrive.live.com/redir?resid=C33077BF9C9F3FF5!1461&authkey=!AI9WtWBLFYZe1D4&ithint=file,html
Sorry for the delay.
I viewed your file on my Windows 7 in a number of different browsers, viewing both the Epilog and the page displayed before it, both of which have text longer that my screen and there were no issues with scroll to top.
You can either wait for someone with Windows 8+ to look at your issue or take cassiealexander suggestion on trying SugarCube.
Just dump a load of Lorem Ipsum in one passage, scroll to bottom, link to next page of LI, and there you go - it doesn't scroll to the top. (And no - this problem doesn't occur in Firefox or Internet Explorer 11.)
This is a serious problem for my project as it's very confusing for the player - they won't think to scroll up.
I cannot switch to SugarCube or whatever without spending months rewriting my project. For now I'm going to have to dump img-hack javascript after every long passage.
If I sound a bit pissed, it's because Twine 2 deleted a load of my work yesterday, fucked with the layout this morning and then deleted more work I did ages ago. It's testing my patience.
Attached is a demo of the bug. Test it in Chrome.
1. Firefox 35 and IE 11: The page scrolls to the top automatically when using the link to display passage 2, it also scrolls to the top if I issue "$('html').scrollTop(0);" in the console, but not when I issue the same against the "body" tag.
2. Chrome 40: The page does not scroll automatically when using the link to display passage 2, but it does scroll to top if I issue "$('body').scrollTop(0);" in console but not when I issue the same call against the "html" tag.
So Chrome may need to use the "body" tag and the other two the "html" tag.
window
ordocument
. For example: Why it's targeting the<html>
element instead (equivalent todocument.documentElement
), I don't know.Secondly, I can't think of a normal situation where the default should be to reset the vertical scroll only, so it should probably be calling
scrollLeft()
as well. For example:Thirdly, unless something special is going on, using jQuery for this seems a tad silly as
window.scroll()
is as old as dirt. For example:I'm actually at that stage. I can't move forward without a fix for this bug.
My 1st draft is finished but I can't show it to anyone with this bug still in effect.
That being said: I can't actually reproduce this scrolling bug at the moment, using either Chrome 40 Mac or Firefox 35 Mac, running both my own tests (with links at the bottom of multiple screens of text) and those of the attached file earlier in this thread.
But, based on the description of the problem, I think it might be hacked out by adding this to Story Javascript: If this doesn't work, do reply here with haste.
I don't recommend doing this - it means that every click will scroll to the top. Any hooks or fancy stuff you do will be for naught because the page will jump to the top with every click.
Yes, this works. I think I'm on Chrome 39 here - so it may be that the Chrome team fucked this up.
Thankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyou.