/    Sign up×
Community /Pin to ProfileBookmark

Adjusting viewable size of page

Hey everyone I’m new here and pretty crap at javascript.

Basically what I’m trying to do is change the amount of the page that can be viewed. You see I have flash SWF embedded at a resolution of 999 * 2000 but depending on what is playing I wont use all of that. Iv been trying to find a way around this but all I’v found is how to change the size of the whole browser window which I dont want, I need the browser to remain fullscreen but merely change how far down on the page you can scroll down.

any ideas? is it possible?
Thanks in advance

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscMar 21.2009 — EDIT: My bad, mis-read the question
Copy linkTweet thisAlerts:
@FangMar 22.2009 — Set the required height of the body and overflow:hidden;
Copy linkTweet thisAlerts:
@makoinaterauthorMar 22.2009 — But can it be changed dynamically? I understand how to pass variables to javascript from my flash but Its essential that it can change when needed without leaving the page, if you get me.
Copy linkTweet thisAlerts:
@FangMar 22.2009 — Either change the [I]style [/I]or [I]class [/I]can be achieved:document.body.style.height='XXXpx';
document.body.style.overflow='hidden';
Copy linkTweet thisAlerts:
@makoinaterauthorMar 22.2009 — Thanks I'll give it a shot, ill let you know how it works out
Copy linkTweet thisAlerts:
@makoinaterauthorMar 22.2009 — Ok when I type this :

document.body.style.height= '1000';

document.body.style.overflow='hidden';

It completely stops me scrolling down at all no matter what figure I put in.

but when I have

document.body.style.height= '1000';

on its own it will change the scrollable area but only after my embedded swf, I tried using negative figures but cant get it to work. does it matter which tags I place the code in? Iv put it inside both the HEAD and BODY tags
Copy linkTweet thisAlerts:
@FangMar 23.2009 — You must add units[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<style type="text/css">
body {height;1000px;}
</style>

</head>
<body>

<script type="text/javascript">
document.body.style.height= '1000px';
</script>
</body>
</html>
[/codde]
×

Success!

Help @makoinater spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...