Dear All
I am not only new to this forum but also new to designing web sites for mobile devices, so please be gentle with me. I do, however, have many years experience of web site design for standard PC browsers.
I have been trying to make my web site "mobile friendly" but have hit a number of quite basic problems, listed below.
Note that I am currently redirecting users to the mobile version of my site using the following JavaScript on my home page:
if (screen.width <= 1000) {
document.location = "phone/index.htm";
}
Is that OK?
Here are my main questions:
1. My mobile home page is taller than a mobile screen, so I need vertical scrolling, but when I first go to my site (using the standard packaged browser on my Samsung S3 running Android), I cannot, initially, scroll the window. However, if I turn the device on its side, to switch to landscape mode, then back again, magically scrolling is now enabled. Any ideas why?
2. I have a link that's a little way down the home page so I have to scroll to reach it. If I then click on the link, the correct new page is displayed BUT it's scrolled down the same amount as the page I just left. In other words, on following the link, vertical scroll isn't being reset to zero. Again, any ideas?
3. Final question. I have a page where I want to display the same content on both PC and mobile devices but using different font sizes etc. I have a separate style sheet for mobile. I therefore tried the following in my <head>:
<link REL="stylesheet" TYPE="text/css" HREF="Panel.css">
<script type="text/javascript">
if (screen.width <= 1000) {
document.styleSheets= "phone/ps.css";
}
</script>
Unfortunately this seems to have no effect. It doesn't switch to the ps.css style sheet and the text comes out using the font sizes from the PC style sheet (Panel.css). Is there a standard way to use the same page, but with different style sheets, for pc/mobile?
For your reference, in case you want to look at the site, it's [
writerman.org.uk....]
Thanks in advance
Keith Sheppard (children's author)