Cycle through different sized images on scroll
Hi all,
I am trying to change through images when scrolling, (and I understand that maybe the jquery is a bit messy but it seems to be working) but i would like:
- to be able to have images of different heights and widths, not all the same size (as it is now).
- vertically/horizontally centered.
Thanks!
HTML:
CSS:
- body,
- html {
- height: 7000px;
- margin: 0;
- background-color: grey;
- }
- .hidden {
- position: absolute;
- top: -9999999px
- }
- #bottommark {
- position: absolute;
- bottom: 0;
- }
- #contentwrapper {
- width: 100%;
- height: 100%;
- position: fixed;
- }
- .centreme {
- position: fixed;
- width: 200px;
- /* the image width */
- height: 200px;
- /* the image height */
- top: 50%;
- left: 50%;
- margin-top: -100px;
- /* half the image height */
- margin-left: -100px;
- /* half the image width */
- }
JS: