Email: info@zenconix.com

Show and hide scroll bar by jquery

Published on: 11/17/13 12:55 PM

Category:Code Tags:

Today we will see how to hide and show scroll bar of the table in div by Jquery mouse events

what I will do here , is I have created one table in div section for showing scroll bar I reduced the size of the div and when i will move the mouse on that div i will show the scroll and when will leave the mouse from div then hide scroll

HTML

[sourcecode language=”csharp”]
<div id="tableDiv" style="overflow: auto; width: 300px; height: 200px;">
<table border="1" id="table">
<tr>
<td>first TR first TD</td>
<td>first TR second TD</td>
<td>first TR third TD</td>
<td>first TR forth TD</td>
<td>first TR fifth TD</td>
<td>first TR sixth TD</td>
</tr>
<tr>
<td>second TR first TD</td>
<td>second TR second TD</td>
<td>second TR third TD</td>
<td>second TR forth TD</td>
<td>second TR fifth TD</td>
<td>second TR sixth TD</td>
</tr>
<tr>
<td>third TR first TD</td>
<td>forth TR second TD</td>
<td>fifth TR third TD</td>
<td>sixth TR forth TD</td>
<td>seventh TR fifth TD</td>
<td>eigth TR sixth TD</td>
</tr>
</table>
</div>
[/sourcecode]
[sourcecode language=”csharp”]
/*————————————
show scroll bar on mouse move and again hide on mouse leave */
$("#tableDiv").mousemove(function () {
$(this).css("overflow", "auto");

});
$("#tableDiv").mouseleave(function () {
$(this).css("overflow", "hidden");
});
[/sourcecode]

for more visit ,
Demo


Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

How Angular Application starts?

In this post we are going to take look on how angular application starts. For any angular application, entry point is index.html. In index.html file there is tag called as <app-root> In main.ts file <app-root> selector is picked up by the AppModule. Below is code snippet from main.ts file AppModule is module which is bootstrapped […]

Learn C# – Namespaces

What is Namespaces in C#? C# Programs are organized using namespaces. Namespaces are used to add separation of Code in C#. Namespaces can have following members inside it. Namespaces (nested) Classes Interface Delegates Structures Why to use Namespaces? Code Separation: With help of Namespaces, you can separate out set of code in C# Project.Example: if […]

Steps by step procedure to connect the database to Lumen

Create database in phpmyadmin Open .env file. NOTE: if .env file is with name, .env.sample, then rename it to .env Change following parameter in file DB_DATABASE=lumen DB_USERNAME=root DB_PASSWORD= Also check for following parameters if they are different than default setting DB_HOST=127.0.0.1 DB_PORT=3306 Next, as we are going to use Eloquent ORM, we need to un-comment […]