- Create Account

How to auto-scroll page so max room available for pix?

Forums > PhotoMorpher > How to auto-scroll page so max room available for pix?
Author
Message

1) gprang Group: Members
Posts: 5 Joined: 2 Jan 2007 Location: CA, USA IP: 69.227.--.--
Many thanks to TwinHelix for PhotoMorpher... I think I have attributed correctly but if not, let me know! My idea is to have the page scroll when the "Next" or "Play" button is pushed, so any other content moves out of the way, allowing room for big pix on smallish screens. I know how to make an <A> anchor point, but not how to make javascript utilize it, sorry, I mean utilise it. My instance of PhotoMorpher is at http://www.creative-eye-studio.com/projects.htm
 if you wish to check it out. Thanks!

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
In an ONCLICK event for the buttons put this code:

location.hash = 'photomorpher';

and in the source code put this:

<a name="photomorpher" id="photomorpher">

which should do the trick nicely :). And thanks for the credit, it's quite fine!

Good luck - Angus.

3) gprang Group: Members
Posts: 5 Joined: 2 Jan 2007 Location: CA, USA IP: 69.227.--.--
Angus, Thanks for your help. I ended up with
addEvent(photo, 'setup',  function() {
    addEvent(document.getElementById('photoPrev'), 'click',
     new  Function('photo.prev(); return false'));
 location.hash = 'photomorpher';
which  loads the page initially at the anchor point (the legend "Photo Gallery"). I first thought I wanted the page to load at the very top and move down only upon the first click, but it actually looks better loading to the anchor point at pageload.
Thanks!

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.