[Pro] Defining page view in browser

Hi guys,

How can I achieve something a little like this.

I can do the smooth scrolling anchors bit no problem, but how can I define the page view to start (in the browser) half way down (or indeed at the bottom of the page) and then scroll up?

Thanks for your help in advance
Jon


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I am still trying to define a section of the page to view on start up. The site I mentioned seems to be using a number of javascripts. This one seems to suggest what I am after but could one of you guys take a look and see if I am barking up the wrong tree.

If this is the script to use… should I need an external javascript file too or could this be added to the HEAD of the page to achieve what I’m after?

As you you might have guessed, my knowledge of code is somewhat lacking.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This is a normal Google tracking code function. It doesn’t do anything
with the view. Could you post a link to the page?

Walter

On Feb 9, 2010, at 11:46 AM, wingnut wrote:

I am still trying to define a section of the page to view on start
up. The site I mentioned seems to be using a number of javascripts.
This one seems to suggest what I am after but could one of you guys
take a look and see if I am barking up the wrong tree.

If this is the script to use… should I need an external javascript
file too or could this be added to the HEAD of the page to achieve
what I’m after?

As you you might have guessed, my knowledge of code is somewhat
lacking.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here’s the link to what I am trying to achieve.

I have no problem producing the smooth scrolling anchors… but rather than start the page at the top in the brower, this one starts half way down and then has the option to scroll up or down. How do you specify the page to do this?

Thanks for the help Walt, I really appreciate it.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

DOH!.. here’s the link


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

They are using the anchor #home to trigger the smooth scroll down.
This is a common feature of many smooth-scroll scripts. Try making a
DIV (HTML box) half-way down the page, and then hand-type in the name
of that box as the hash portion of the URL in your browser and press
Return. See if it smooth-scrolls down to meet you.

http://example.com/page.html#item11

(fake URL, just to show what I mean by the hash portion – this would
say item11 in the Name field of the Inspector in Freeway)

Walter

On Feb 9, 2010, at 12:05 PM, wingnut wrote:

DOH!.. here’s the link

http://www.morphix.si


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Ahhh I see. It all becomes completely clear now. I didn’t even think to look at the URL of the browser. Makes perfect sense. Thanks ever so much.

Ever thought of becoming Guru Walt!?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks again for your help Walter,

Sorry to be a pain. If I wanted the user to go straight to the anchor when first viewing the page, by just typing the URL without the need for adding #anchorname at the end… would I need to add something on the server like a redirection address or could this be written as a script in the HEAD of the page?

Thanks gain

Jon


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You could test to see if the page had an anchor, and if not, redirect to a default one. Off the top of my head, this would look something like this in JavaScript.

if(! window.location.hash || window.location.hash == undefined){
    var base = window.location.href;
    if (base.indexOf('#') > -1) base = base.split('#')[0];
    window.location.href = base + '#yourdefaultanchor';
}

That should redirect your visitor to the default anchor as soon as they hit the page. (Put all that in a script block, naturally, in the before /head part of the page.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Cheers Walter,
Really appreciate the help. I’ll give it a try.

Jon


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 10 Feb 2010, 12:22 pm, waltd wrote:

You could test to see if the page had an anchor, and if not, redirect to a default one. Off the top of my head, this would look something like this in JavaScript.

if(! window.location.hash || window.location.hash == undefined){
    var base = window.location.href;
    if (base.indexOf('#') > -1) base = base.split('#')[0];
    window.location.href = base + '#yourdefaultanchor';
}

That should redirect your visitor to the default anchor as soon as they hit the page. (Put all that in a script block, naturally, in the before /head part of the page.

Walter

I don’t seem able to make this come out right and it is probably just a coding issue as I am unfamiliar with it. The idea is to have the home page open halfway down the page at a specific spot/ anchor. When I place the code above “before ” I just end up with the actual line of code sitting at the top of the page.
Thanks for any assistance,
Chris


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Wrap that code in a script tag:

<script type="javascript">
your code here
</script>

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options