鼠标悬浮显示二级菜单

1.布局:

<div class="show">
            <img src="~/images/head_icon.png" />

            <div class="drop" style=" display:none; z-index:80000" id="profileMenu">
                <ul>
                    <li>
                        <a class="pass" style="cursor: pointer"
                           href='#'>
                            <span>修改密码</span>
                        </a>
                    </li>
                    <li>
                        <a class="quit" style="cursor: pointer"
                           href='#'
                           ><span>退出</span></a>
                    </li>
                </ul>
            </div>
        </div>

2.js控制:

function dropMenu(obj) {
        $(obj).each(function () {
            var theSpan = $(this);
            var theMenu = theSpan.find(".drop");
            var tarHeight = theMenu.height();
            theMenu.css({ height: 0, opacity: 0 });

            var t1;

            function expand() {
                clearTimeout(t1);
                //theSpan.find('a').addClass("selected");
                theMenu.stop().show().animate({ height: tarHeight, opacity: 1 }, 200);
            }

            function collapse() {
                clearTimeout(t1);
                t1 = setTimeout(function () {
                   // theSpan.find('a').removeClass("selected");
                    theMenu.stop().animate({ height: 0, opacity: 0 }, 200, function () {
                        $(this).css({ display: "none" });
                    });
                }, 250);
            }

            theSpan.hover(expand, collapse);
            theMenu.hover(expand, collapse);
        });
    }
时间: 2024-08-29 23:23:52

鼠标悬浮显示二级菜单的相关文章

Html中鼠标悬停显示二级菜单的两种方法

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> ul{ list-style: none; float: left; } li{ display: none; } </style> <script type="text/

Selenium笔记---鼠标悬停显示二级菜单 点击下拉列表

WebElement menu1=driver....... WebElement menu2=driver....... Actions builder = new Actions(driver); Actions hoverOverRgeistrar = builder.moveToElement(menu1); hoverOverRgeistrar.perform(); menu2.click(); // builder.moveToElement(element).perform();

鼠标悬浮显示文字半透明背景

鼠标悬浮显示文字半透明背景 鼠标悬浮头像,出现文字"上传头像",之前都是使用< a title="上传头像"></a>这样的title来实现现在设计稿,是在头像上面,显示的大号字体的文字,且有一层黑色遮罩层第一想法是,多写一个层,悬浮时候,出现即可多想一步,使用css的content:"",来实现content后面的是双引号针对半透明黑色背景层background:#000opacity:0.5这是透明了全部(背景色和文字

div跟随鼠标悬浮显示

<span style="font-size:18px;"><!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author"

bootstrap 鼠标悬浮显示备注信息 两种实现方式

一,(默认黑色字体白色背景) sb.append("<td><a data-content='"+rowData[8]+"'>").append(rowData[4]).append("</a></td>"); $(function(){ // 初始化 popover,触发方式为手动触发 $('a').popover({ trigger: 'manual' }) .on('mouseover', f

div居中鼠标悬浮显示下拉列表

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-

bootstrap hover显示二级菜单

$(document).ready(function(){dropdownOpen();});function dropdownOpen() {var $dropdownLi = $('li.dropdown');$dropdownLi.mouseover(function() {$(this).addClass('open');}).mouseout(function() {$(this).removeClass('open');});}

鼠标移动现实二级菜单

*{ margin:opx auto; padding:0px;} #leibie{ width:500px; height:36px; border:1px solid #03F;} .yuyan{ float:left; width:100px; height:36px; text-align:center; line-height:36px; vertical-align:middle; font-weight:bold;} .yuyan:hover{ cursor:pointer; ba

鼠标悬浮标签显示提示内容

1.鼠标悬浮显示内容,可直接在标签里加个title 2.js实现 在标签里定义id 鼠标onmouseover 属性在鼠标指针移动到元素上时触发showstatus(id)函数 鼠标onmouseout 属性在鼠标指针移动到元素外时触发hiddenstatus(id)函数 例:<p id="pid" onmouseover="showstatus(this.id)"  onmouseout="hiddenstatus(this.id)"&g