Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting the Scrollbar

Status
Not open for further replies.

allenac

Programmer
Joined
Jun 11, 2006
Messages
2
Location
US
I am a Flash designer who is slowly learning more HTML and Javascript to be more well rounded as a designer. I have a need to have more control over my scrollbars. I know how to open a new browser window and have it upon loading the page, scroll down to a certain pixel coordinate. But then the user can simply scroll up to see the hidden content. Is there a way that I can prevent the scroll bars from going above a certain y coordinate? Say, rather than the top of the page being y=0 have it stop at y=30? Also the same question for scrolling down? I dont want to remove the content at the top, I simply want to hide it from the user and not allow them to scroll up and see it. Any help would be great. Thanks in advance.

Drew
 
>> simply want to hide it from the user and not allow them to scroll up and see it. Any help would be great.

wht are utrying to add? why not put the content that u want to hide in hidden layers???

Known is handfull, Unknown is worldfull
 
The site that I want to add the code to is an online store that is powered by another company and they like to put a top banner to promote themselves. So I have added some javascript to scroll down 30 pixels upon loading so that the banner is hidden. I cant remove or hide that banner because I dont have control of that part of the code. I want to restrict the scrollbars from being able to scroll back up to see their advertisment.

Drew
 
why not try and hide the ad? but first take into account the legal aspects. the best way is to use DOM and remove all the tags above ur flash file if u want to make a clean job of it...

Known is handfull, Unknown is worldfull
 
Blocking their ad banner could put you in violation of any agreement with the company that is posting the ad banner as they are obviously providing some form of service.

What approaches you take to block their ad banner depends on how you are displaying the information on your page as well.
You could try trapping the onscroll event and if the page ever scrolls up above a certain position you set it back again. You could try using DOM methods to find and remove their tags as vbkris suggests or you could try floating another object on top of their ad banner.
Again though, this could put you in a position where they could take action against you if there is an agreement in place stipulating the acceptance of their page the way it is presented without modification.


Google, you're my hero!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top