Mouse over elements, div display, and move down according to ScrollTop

Source: Internet
Author: User

As shown, there are many channels and there is only one table.

Note: If the mouse hovers over the channel, the table does not appear and the table does not disappear when the mouse slides over the table.

<div id= "Linecontent" >

<p class= ' channel ' ></p>

<span class= ' ChannelName ' ></span>

<p class= ' channel ' ></p>

<span class= ' ChannelName ' ></span>

<p class= ' channel ' ></p>

<span class= ' ChannelName ' ></span>

<p class= ' channel ' ></p>

<span class= ' ChannelName ' ></span>

<p class= ' channel ' ></p>

<span class= ' ChannelName ' ></span>

</div>

<div class= ' collections_content ' >

<div class= "title" > Backlog information <span class= "Thischannelname" ></span> </div>

<table class= "Table Table-hover table-striped" id= "Backloggrid" ></table>

</div>

Style, I won't add it.

Collections_content based on positioning

Here is the JS

var detailshowlock = null;
var detailcloselock = null;
function Clearlockedtimeout () {
if (Detailshowlock) {
Cleartimeout (Detailshowlock);
}
if (Detailcloselock) {
Cleartimeout (Detailcloselock);
}
}
$ ("#lineContent"). On (' MouseOver ', '. Channel ', function (e) {
Clearlockedtimeout ();
var _self = this;
Detailshowlock = SetTimeout (function () {
var index = $ (_self). attr (' Data-index ');
var top = $ (_self). Offset (). Top;
$ (". Collections_content"). Show (). CSS ({' Top ':(TOP-200/2-5)});
Self.getchannelgrid (index);
}, 250);
})
$ ("#lineContent"). On (' Mouseout ', '. Channel ', function (e) {
Clearlockedtimeout ();
Detailcloselock = SetTimeout (function () {
$ (". Collections_content"). Hide ();
}, 250);
});
$ ('. Collections_content '). Hover (function () {
Clearlockedtimeout ();
$ (this). Show ();
}, function () {
Clearlockedtimeout ();
Detailcloselock = SetTimeout (function () {
$ (". Collections_content"). Hide ();
}, 250);
});

On demand.

Mouse over elements, div display, and move down according to ScrollTop

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.