开发者社区> 问答> 正文

鼠标移入图片 这个效果如何以最少的代码实现?比如只用css可以吗

多张图片
1.鼠标移入图片,出现下拉按钮,mouseover show
2.点击下拉按钮,出现下拉框,click slidedown
3.移开下拉框区域,下拉框收回,mouseout slideup
4.移开图片,下拉按钮消失 mouseout hide

用css如何实现?或者简短的jquery代码?js代码呢?

展开
收起
杨冬芳 2016-05-31 18:50:30 2164 0
1 条回答
写回答
取消 提交回答
  • IT从业
    <style>
    .box {
        width: 100px;
        height: 100px;
        position: relative;
    }
    .select {
        width: 100px;
        height: 20px;
        position: absolute;
        top: 0;
        left: 0;
        display: none;
    }
    .box:hover .select{
        display: block;
    }
    .select ul {
        position: absolute;
        width: 100px;
        height: 40px;
        display: none;
    }
    .select li {
        width: 100px;
        height: 20px;
        float: left;
    }
    .select:hover ul{
        display: block;
    }
    </style>
    2019-07-17 19:22:23
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
零基础CSS入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载