O'Reilly logo

PHP jQuery Cookbook by Vijay Joshi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Floating box on demand

Imagine a page having a long list of products where you can select multiple products and the list gets updated in a separate container. On reaching the bottom of such a page, you may forget what you have selected previously as the box holding your selections is sitting at the top of the page.

Would it not be great if such a container box also scrolled as you scroll on the page? In other words, how about a floating box that scrolls on the page as you go up or down the page.

This recipe will show you how to create a floating box that will scroll on the page automatically as you scroll up or down on a page.

Getting ready

Create a folder named Recipe5 inside the Chapter6 directory.

How to do it...

  1. Create a file named index.html

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required