/    Sign up×
Community /Pin to ProfileBookmark

A couple things

On a page I am going to have 50 thumbnails, is there a way to write one function so that if any of them were to be clicked on, they would open 400×300.

2, is there a way I could use both the OnBlur, and OnClick to close the window? <body onBlur=”window.close”, onClick=”window.close()”> won’t work, how should I word this so when either event takes place the window closes?

Thank you,

Shawn

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@scragarApr 19.2005 — 1) [code=php]<script>
function foo(Oobj){
window.open(Oobj.src);
};
</script>
<img src="img1.gif" onclick="foo(this)" /><img src="img2.gif" onclick="foo(this)" />
<img src="img3.gif" onclick="foo(this)" /><img src="img4.gif" onclick="foo(this)" />
<img src="img5.gif" onclick="foo(this)" /><img src="img6.gif" onclick="foo(this)" />[/code]


2)

<body onblur="window.self.close()" onclick="window.close()"> -- untested.
×

Success!

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