/    Sign up×
Community /Pin to ProfileBookmark

on browser window release…

Can anyone help? I’ve got a script to shake the browser window which works fine on an ‘onLoad’ event handler. I wondered if there is a way to call the shake function if the user either resizes the window or moves the whole browser window to a different location?

If so could you show me how to implement the code into the html?

Many thanks

Ryan
?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Mar 10.2005 — onresize="YourAnnoyingScriptThatWillMakeUsersLeave()"

onmove="YourAnnoyingScriptThatWillMakeUsersLeave()"

Eric
Copy linkTweet thisAlerts:
@boobourneauthorMar 10.2005 — Thanks for the reply but I still can't get it to work - can you check through my code and let me know where I'm going wrong?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

<SCRIPT LANGUAGE="JavaScript1.2">

<!-- Begin

netscape = (navigator.appName == "Netscape");

n4 = netscape && (parseInt(navigator.appVersion) >= 4);

explorer = (navigator.appName == "Microsoft Internet Explorer");

ie4 = explorer && (parseInt(navigator.appVersion) >= 4);

function shake(n) {

if (n4 || ie4) {

for (i = 10; i > 0; i--) {

for (j = n; j > 0; j--) {

self.moveBy(0,i);

self.moveBy(i,0);

self.moveBy(0,-i);

self.moveBy(-i,0);

}

}

}

}

// End -->

</script>

</head>

<script>onMove="shake(02);"</script>

<BODY>

<div align="center"><img src="jellyWeb01.jpg" width="780" height="832" /></div>

</body>

</html>

Cheers

Ryan
×

Success!

Help @boobourne 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.6,
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,
)...