CSS/HTML:鼠标按下取消
我有一个使用 CSS 主题化的链接。我应用了向上、向上和向下 CSS 属性,这些属性都有效。
问题是,当您将鼠标放在按钮上,拖走然后放开取消时,按下状态仍然会应用,直到您再次单击某些空白区域。
您可以通过在按钮 1、2 和 4 上执行上述操作来了解我的意思:http://jsfiddle.net/2vjbz /
如何通过不必再次点击来“刷新”?
I have a link being themed using CSS. I have up, over and down CSS properties applied which all work.
Problem is, when you hold down the mouse over a button, drag away then cancel by letting go, the down state is still being applied until you click again on some white-space.
You can see what I mean by doing the above on buttons 1, 2 and 4 here: http://jsfiddle.net/2vjbz/
How do you 'refresh' by not having to click again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您的CSS,我认为这种行为是正确的,但问题是鼠标向上事件没有被触发并且链接元素仍处于活动状态。您可以使用 jQuery 通过调用链接元素的鼠标向上事件来修复它。
一种方法是当鼠标在寻呼机 div 中移动时调用它
您可能需要添加条件以使其完美
编辑:
您可以尝试一下。这是另一种方法
http://jsfiddle.net/diode/2vjbz/18/
这里它取消拖动事件。这两者都对我有用。
According to your CSS, I think this behavior is correct, but the problem is that mouse up event is not getting triggered and link element remains in active state. You can fix it using jQuery by invoking mouse up event for link element.
One method is to invoke it when mouse moves in pager div
You might need to add conditions to make it perfect
EDIT:
You can experiment with it. This is one more method
http://jsfiddle.net/diode/2vjbz/18/
Here it cancels the drag event. Both of these worked for me.