?
Solved

How to avoid page scroll ?

Posted on 2011-04-22
3
Medium Priority
?
307 Views
Last Modified: 2012-05-11
Please take a look at this page,

http://www.watchonlinemoviesite.com/watch_hanna_movie_free_online/

Open in new window


in the middle, before the comments, there's a div's background that thanks to jquery i make change,
what i need to avoid is the page to scroll in a different position due to the show method.

Please help me improve this code in order to avoid page scroll

<script>
$(document).ready(function(){ 
$("#movieLinks").mouseenter(function() {
   $('#movieLinks').fadeOut('slow', function(){
		$('#movieLinks').removeClass('ml1').addClass('ml2').fadeIn('fast');
		$('#movieLinks').unbind('mouseenter').unbind('mouseleave');
		$('#movieLinksVisit').show(500);
		$('#movieLinksLeft').css('cursor','wait');

   }) 
   })
});
</script>

Open in new window

0
Comment
Question by:fario
  • 2
3 Comments
 
LVL 2

Expert Comment

by:pixalax
ID: 35466079
You could add a simple class / style to your div element and here is the css you are looking for

div.hideScroll {
overflow:hidden;
}

Open in new window

0
 
LVL 1

Accepted Solution

by:
fario earned 0 total points
ID: 35759800
That didn't fix the problem

I found this to be the solution

http://alexcuesta.wordpress.com/2009/10/14/jquery-how-to-avoid-scrolling-when-using-fadeinfadeout-effects

Open in new window

0
 
LVL 1

Author Closing Comment

by:fario
ID: 35791833
it works
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question