• Skip to content
  • Skip to primary sidebar

Dynamic Drive Blog

  • JavaScript
  • CSS Library
  • Help Forums
  • Tools
Home / Site News / Pausing Up Down Scroller rewritten with CSS3 superpowers!

Pausing Up Down Scroller rewritten with CSS3 superpowers!

December 21, 2016 by Dynamic Drive

The classic Pausing Up Down Scroller has gotten more than an oil change, with a complete rewrite that now uses CSS transitions for the smoothest up down scrolling animation possible! Along with mobile optimized performance, the scroller is now also responsive, letting you specify a percentage width that expands and contracts to the parent container’s dimension. You can now also dynamically pause, resume or re-populate the scroller with new contents. Check out the new script here.

On a technical note, we ran into a huge hurdle when trying to use CSS3 transitions to animate the two children DIVs of each scroller into view that was initially out of sight due to its parent container being set to overflow:hidden on Chrome iOS devices. The animating DIV refused to be visible as it was transitioning into view and towards its final position until the very end of the transition, remaining hidden along the way. The issue seems to stem from iOS’s aggressive optimizations that only updated an initially obscured DIV’s visibility at the end of a transition, and not in real time. We got around this problem by making sure the obscured DIV was partially visible from the get go, by defining a child pseudo element that poked out into the visible area of the parent DIV. This was realized using the following CSS inside the scroller:

div.pausescroller > div.innerDiv:before{
    content: '';
    position: absolute;
    bottom: 100%;
    height: 1000px;
    width: 1px;
    z-index: -1;
}

With this code the .innerDIV DIVs carry a pseudo element that extends upwards into the visible area of the parent container, even while the DIVs themselves and their contents are initially hidden from view, forcing Chrome iOS browsers to not make assumptions about the DIVs’ visibility as we transition them. This is a technique you may find useful.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to email this to a friend (Opens in new window)

Filed Under: CSS, Site News Tagged With: New Script

Reader Interactions

Primary Sidebar

Featured Posts

  • Best Wordpress Theme Clubs and BundlesBest WordPress Theme Clubs That Offer Multiple The…
  • 7 Wordpress and Web Design Trends for 20187 WordPress and Web Design Trends to Watch in 2018
  • Add Custom JavaScript and CSS to WordPress
  • Best Wordpress Page Builders Compared and ReviewedBest WordPress Page Builders Compared and Reviewed
  • WordPress Genesis: Showing a different Featured Im…

Categories

  • CSS
  • Entrepreneurs
  • JavaScript
  • Plugins
  • Site News
  • Software
  • Web Building
  • Web Design
  • Wordpress
  • RSS Feeds
  • Twitter
  • Facebook
  • FAQs
  • Free Newsletter
  • Usage Terms
  • Contact
Affiliate Disclaimer: I earn a commission from some products mentioned. All opinions are my own. Copyright 2018 Dynamic Drive [ Top ]
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.