We help IT Professionals succeed at work.
Get Started

scrolling with jquery

debbieau1 asked
Last Modified: 2012-06-22
I found this useful jquery scrolling code, but need to modify to allow for horizontal scrolling as well.  It works great, but only for vertical scrolling.
$().ready(function() {
            var $scrollingDiv = $("#scrollingDiv");
                        .animate({"marginTop": ($(window).scrollTop() + 30) + "px"}, "slow" );                  

Here is the CSS
<div id="scrollingDiv" style="float: left; width: 21%; padding: 0% 2% 2% 2%; margin-left: 4%; margin-top: 30px; border: 2px solid red; background-color: #ffeaea;white-space: nowrap">
Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE