views:

180

answers:

1

on the following site i have two hidden panels labelled "show map" and "show floor plans".

When the the header of each is clicked the slide panel is opened.

The floor plans is long and thus will go below the page view. is there anyway to keep focus at the bottom of the panel, so that when it's clicked you manage to see the whole window opening, thus avoiding scrolling?

the dev link is: http://marldon.staging.dante-studios.com/property.php

Thanks in advance.

+1  A: 

I believe what you're looking for is the scrollIntoView method:

$("#foo").show()[0].scrollIntoView(false);

Passing a value of false scrolls the bottom of #foo to the bottom of the viewport. Passing true or not passing any value aligns the top to the top.

This method is supported both by standards-friendly browsers and by Internet Explorer.

Ben Blank
Nice. I didn't know about this at all.
Paolo Bergantino
hmm i haven't managed to get that to work :/
Shadi Almosri