/    Sign up×
Community /Pin to ProfileBookmark

thumbnail to popup window

Anyone know how to set a maximum size limit for the new window with this one:
[url]http://javascript.internet.com/page-details/resizable-viewer.html[/url]

I like everything about it except some of my images are quite tall and the autosize feature makes the window run off the screen so there is no way to see the bottom of the image.

The autosize feature is one of my favorite things about it so I don’t want to lose that completely, just be able to set a maximum size that it won’t exceed for the window.

thanks!
Trevor

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@pyroSep 27.2003 — Looks like they are storing the height the window needs to be in the variable myHeight, so just check if that is greater than the max you want to allow, and if so, set it to the max, like this:

if (myHeight > 600) {
myHeight == 600;
}
Better yet, since they are detecting the height of the screen, and putting that into the variable height, you could do something like this:

if (myHeight > height) {
myHeight == height;
}
and just be sure you put the code before this line:

var toppos = height / 2 - myHeight / 2;
×

Success!

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