php_beginner_83 Posted October 22, 2009 Share Posted October 22, 2009 Hi All I've just started putting my website online and I realised one more thing I'd like to do to my site but have no clue where to start. I have a photo gallery and when the page opens, the page opens from the top so only the top half of the image is shown and the user has to scroll down to view the whole image. This is what I mean.. http://www.pictiuirshannagh.5gigs.net/photoGallery.php?ID=1 Does anyone know how/if to make it so that when the page opens, its positioned so the image is in view and the user doesnt have to scroll down?? So essentially the page will open already scrolled down a bit. I hope this makes sense. Thanks :-) Quote Link to comment https://forums.phpfreaks.com/topic/178557-how-to-open-a-web-page-already-scrolled-down-a-bit/ Share on other sites More sharing options...
mikesta707 Posted October 22, 2009 Share Posted October 22, 2009 you can create an HTML anchor <a name="#scrollHere"> but you would then have to add that to your link, IE <!-- normal link --> <a href="link.php">link</a> <!-- anchor link --> <a href="link.php#scrollHere">link</a> Quote Link to comment https://forums.phpfreaks.com/topic/178557-how-to-open-a-web-page-already-scrolled-down-a-bit/#findComment-941656 Share on other sites More sharing options...
MatthewJ Posted October 22, 2009 Share Posted October 22, 2009 Yeah, and that is actually relative to screen resolution... when I open it, even without my browser maximized, it opens with the full picture shown. I wouldn't be too worried about it. Quote Link to comment https://forums.phpfreaks.com/topic/178557-how-to-open-a-web-page-already-scrolled-down-a-bit/#findComment-941658 Share on other sites More sharing options...
php_beginner_83 Posted October 22, 2009 Author Share Posted October 22, 2009 Yeah, and that is actually relative to screen resolution... when I open it, even without my browser maximized, it opens with the full picture shown. I wouldn't be too worried about it. Oh great, thanks for letting me know that. Now Im curious though about the anchors. I was looking at putting those in and I'm a little confused how I would do it since my links are a little more complicated than the examples mikesta gave. For example, the link I would use to jump to the anchor would be... <a href=photoGallery.php?ID=$ID> And this link is in a php file that is an include() in albums.php. Does that make sense? Quote Link to comment https://forums.phpfreaks.com/topic/178557-how-to-open-a-web-page-already-scrolled-down-a-bit/#findComment-941664 Share on other sites More sharing options...
mikesta707 Posted October 22, 2009 Share Posted October 22, 2009 to make a link go to an anchor just add the pound sign plus the name of the anchor to the end of the link. for example <a href=photoGallery.php?ID=$ID#anchor> you could also use javascript I guess... but that may be unnecessary because as Matt said it depends on screen resolution and all that. although I suppose you could use Javascript to detect the resolution of a user, and respond accordingly Quote Link to comment https://forums.phpfreaks.com/topic/178557-how-to-open-a-web-page-already-scrolled-down-a-bit/#findComment-941670 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.