Solved

Enable scrollbar at table cell, HTML, Javascript

Posted on 2007-04-11
4
886 Views
Last Modified: 2008-02-01
Hi there,
I am creating an html page. I have a table, and in one of them i have enabled the scrollbar using
<div style="width:600px;height:400px;overflow:auto;">
However i would like to show the scrollbar and enable it only when the mouse is over that cell.
Anyone know how to do that in javascript?
0
Comment
Question by:ioustinos_sarris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
sankarbha earned 50 total points
ID: 18889919
try this:

<script language='javascript'>

function mouseover_divOne()
{
      document.getElementById('divOne').style.overflow='scroll';
}
function mouseout_divOne()
{
      document.getElementById('divOne').style.overflow='auto';
}

</script>

<div
id='divOne'
style="width:600px;height:400px;overflow:auto;"
onmouseover='mouseover_divOne();'
onmouseout='mouseout_divOne();'
>cell</div>
0
 
LVL 8

Expert Comment

by:jawahar_prasad
ID: 18891521
sankarbha's code is a good one...
0
 

Author Comment

by:ioustinos_sarris
ID: 18899896
seems very good...however
a. why when the scrolling of the list ends the normal page start scrolling?thats not really nice
b. how can i hide the horizontal scroll bar?
0
 
LVL 8

Expert Comment

by:sankarbha
ID: 18903684
I dont get point (a)
Point (b) To hide horizontal scroll bar
<script language='javascript'>

function mouseover_divOne()
{
      document.getElementById('divOne').style.overflowY='scroll';
}
function mouseout_divOne()
{
      document.getElementById('divOne').style.overflowY='auto';
}

</script>

<div
id='divOne'
style="width:600px;height:400px;overflow-y:auto;"
onmouseover='mouseover_divOne();'
onmouseout='mouseout_divOne();'
>cell</div>

0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Telerik RadEditor Control Save 8 39
Call a VB.net function in Javascript 6 51
Make qty change inside array as well 1 15
Javascript function 3 12
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

734 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