I created a div that when hovering, reveals a form. the problem is each time im moving the cursor the transition takes place and filling the form become impossible. how can i make the transition work once and than stay/ last for long time?
*i found some information about the delay option but i didn't find a way to modify the delay time separately for the first hovering and then for when the cursor moves out of the div (when "unhovering")
. im looking for a pure css sulotion HTML:

我创建了一个div,当悬停时,会显示一个表单。问题是每次移动光标时都会发生转换,填写表格变得不可能。如何让过渡工作一次,而不是长时间停留/持续? *我找到了一些关于延迟选项的信息,但我没有找到一种方法来为第一次悬停分别修改延迟时间,然后在光标移出div时(当“悬浮”时)。我正在寻找一个纯粹的CSS广告HTML:

<form id="women">
          <label >
              <input type="text" name="fullName" >
          </label>
</form>
<div id="wcover"></div>

css:

#wcover{
    right: 177px;
    z-index: 1;
    top: 291px;
    position: absolute;
    width: 337px;
    height: 402px;
    background: yellow;
    -webkit-transition: height 2s; /* For Safari 3.1 to 6.0 */
    transition: height 2s;
}   


#wcover: hover{
    height: 0px;
    background:black;
}

5 个解决方案

#1


2

Assuming your div is before the form, you may use a transition (e.g. of the opacity property) with a long delay on "unhover"

假设你的div在表单之前,你可以在“unhover”上使用一个转换(例如不透明属性)和一个长延迟

e.g.

Markup(*)

<div id="wcover">hover me</div>

<form id="women">
  <label >whats your name</label>
  <input type="text" name="fullName">
</form>

Css

form {
  opacity: 0;
  transition: opacity 1s 999999s;
}

div:hover + form {
  opacity: 1;
  transition: opacity 0s;
}

After the hover event, thanks to the delay inserted, the user may takes up to 999.999 seconds (approx.ly 277.7 hours) to fill the form.

悬停事件发生后,由于插入延迟,用户可能需要999.999秒(约277.7小时)才能填写表格。

Live Example: http://codepen.io/anon/pen/dPYOLB

实例:http://codepen.io/anon/pen/dPYOLB


(*)As a side note, for a matter of markup validation, you can't insert an heading into a label.

(*)作为附注,对于标记验证,您不能在标签中插入标题。

更多相关文章

  1. 如何使用struts2访问表单数组字段
  2. 提交一个表单(后台生成id),点击保存并一步后切换到下一个tab中,此t
  3. 使用mysql验证在php中登录表单
  4. 如何在Laravel 5表单请求中使用请求路由参数?
  5. 防止Ajax创建表单的默认值
  6. 在PHP和MySQL中同时插入来自多个表单的多个值
  7. 如何使用PHP在表单中找到移动复制
  8. 提交动态复选框表单并成对获取值
  9. 仅在LARAVEL或AJAX中提交表单时,无需用户身份验证即可将文件上载

随机推荐

  1. android gif动画
  2. Android 8.0 新特性
  3. android “设置”里的版本号
  4. Android 测试工具集01
  5. Android(安卓)Android.mk文件各种模版参
  6. Android沉浸式状态栏(二)
  7. android图片的旋转和缩放
  8. Android心得3.4--用Pull解析器解析xml文
  9. Android:Activity(五):Activity加载模式
  10. android如何读取项目中的图片或文件