/    Sign up×
Community /Pin to ProfileBookmark

Modifying an expanding window script

I have this script and I want it to do a few different things.

I want it to load with body onload instead of onclick. And I want it to open fully—it now doesn’t go to the bottom of the screen.
And I want a close text link to appear in the window after it expands.

ALso I would like to know how to make it open at 300 pixel width instead.

<script>
<!–var mylocation=”../index.html”
var winheight=100
var winsize=100
var x=5

function go(){
win2=window.open(“”,””,”scrollbars”)
if (!document.layers&&!document.all){
win2.location=mylocation
return
}
win2.resizeTo(100,100)
win2.moveTo(0,0)
go2()
}
function go2(){
if (winheight>=screen.availHeight-3)
x=0
win2.resizeBy(5,x)
winheight+=5
winsize+=5
if (winsize>=screen.width-5){
win2.location=mylocation
winheight=100
winsize=100
x=5
return
}
setTimeout(“go2()”,50)
}
//–>
</script>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @mickx7 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.28,
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,
)...