/    Sign up×
Community /Pin to ProfileBookmark

Proportionally fitting images in Slideshow 2!

Hi

I have set an overall size for the Slideshow 2! div in the CSS file as follows:

[CODE].slideshow {
height:250px;
margin: 0 auto;
width:420px;
}[/CODE]

I would then like all the images I use in the slideshow to fit within this area (i.e. 420 x 250). The images will all have a height of 250px, but different widths. For widths less than 420px I would like the image to be positioned centrally along the horizontal axis in the div as in this image:

[url=http://emberapp.com/users/nickharambee/images/5][img]http://emberapp.com/nickharambee/images/5/sizes/m.png[/img][/url]

for images wider than 420px I would like them to be positioned centrally along the vertical axis in the div as in this image:

[url=http://emberapp.com/users/nickharambee/images/2][img]http://emberapp.com/nickharambee/images/2/sizes/m.png[/img][/url]

I wonder if it’s possible to achieve this with Slideshow 2! and if not, whether another script will help me achieve this?

Thanks

Nick

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

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