Advertisement

07.23.2007 at 11:33AM PDT, ID: 22714997
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

autoscrolling a table using a mouseover event on the table cells

Asked by brunobear in Scripting Languages, JavaScript, Miscellaneous Web Development

Tags: , ,

Hi all,

I'm hoping to find someone really well versed in event handling for this one.

Here's the scenario:

I am creating a weekly schedule table with a row for each 15 minutes, and a column for each day.  Obviously this is a fairly large table, so I've got it in a div with overflow turned on, so it can be scrolled. The table has some functionality where clicking on a cell either turns the cell 'on' or 'off' - by adding a class to the cell which changes it's background color. Also, if you click, hold your mouse down and drag, it 'paints' the cells by turning them on as well. All of this is working fairly well.
The client would like to add functionality where if you are painting the cells and you drag towards the bottom of the visible area, the table will auto-scroll itself so you can continue painting. We are currently handling this with a mouseover event on the table, so anytime you mouseover a table cell it calls our scrolling function.  The scrolling function checks the mouse position, if the mouse is in the proper position it either scrolls the table up or down accordingly.

The issue we have is that in IE, once the table scrolls the first time, if the mouse is not moved, the scrolling function does not get called again. In FF, it does. It seems like in FF moving the layer underneath the mouse still manages to call the mouseover function but in IE it does not.

I've tried a few things to get around this, but without much luck. We are using jQuery, so I've tried calling the scrolling function using their .scroll() event but that's not working well either. It seems I need to call the scrolling function from an event because we need to pass the event to the function to check the mouse coordinates.

Here's the basic function we are using:

      setUpScrolling: function(e) {
                  bMovingUp = (e.pageY < weeklySchedule.iPrevY);
                  bMovingDown = (e.pageY > weeklySchedule.iPrevY);
                  pageY = e.pageY;
                  if (pageY >= 348 && !bMovingUp) {
                        weeklySchedule.iScrollTimer = setTimeout( function() {weeklySchedule.scrollDown(e)}, weeklySchedule.iScrollInterval);
                  } else if (pageY <= 196 && !bMovingDown) {
                        weeklySchedule.iScrollTimer = setTimeout(function() {weeklySchedule.scrollUp(e)}, weeklySchedule.iScrollInterval);
                  }
                  weeklySchedule.iPrevY = pageY;
      },


I can post other snippets of code if needed but that's the one doing the magic.  It's being attached through jQuery's .mouseover() event.

I wish I could post an example of the page but it's internal and under NDA, sorry.

Any thoughts???


Thanks!Start Free Trial
[+][-]07.23.2007 at 03:24PM PDT, ID: 19552044

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Scripting Languages, JavaScript, Miscellaneous Web Development
Tags: jquery, mouseover, table
Sign Up Now!
Solution Provided By: Zvonko
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.24.2007 at 06:51AM PDT, ID: 19556041

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2007 at 10:19AM PDT, ID: 19558090

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.30.2007 at 09:18AM PDT, ID: 20178627

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42