We help IT Professionals succeed at work.
Get Started

Scrolling left column

Last Modified: 2016-01-14
Hi, thanks to an expert here, I've almost got what I need here: http://dev2.magickitchen.com/testimonials-homestyle.html

user name: pepe, pw: BobTheBuilder45!!

The left column starts to scroll at the right time, so I can still see the bottom item, Special Deals Page, while still seeing the top item, Gifts.

There are two problems I can't solve.

1. Once I start to scroll, there is a space above the words gift. I'd like to tighten that up. See screenshot space.jpg.
2. Depending on how far I scroll down the page, then scroll back up, the word Gifts might return to its proper place, or it might overlap the section above it, or there might be a big space. See screenshot gifts.jpg.

I've wrapped the part to scroll in <div id="scrollingDiv">, and the jquery is:
<script src="js/jquery-1.11.2.js"></script>

var $window = $(window);

function scrollMenu(){
  var pos = $window.scrollTop();
  if (pos > 255)
  $('#scrollingDiv').css('marginTop', (pos-290) + 'px');

$window.bind('scroll', scrollMenu);


Thanks, looking forward to your responses!
Watch Question
This problem has been solved!
Unlock 1 Answer and 10 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