English 中文(简体)
3. 与CSS的超能治疗器
原标题:Override cursor with CSS

我有一张<代码>流:隐藏的 div,我通过允许用户点击和拖拉背景而滚动。 这一空间也有链接和 but。

This is what I do for the CSS:

#div-grabscroll {    
    cursor: url(../img/openhand.cur), move;
}
#div-grabscroll:active {
   cursor: url(../img/closedhand.cur), n-resize;
}

这种做法是巨大的,但实际情况是,如果 mo停止(由于达到滚动限制)在 but子上移动,则 cur(<>点/代码>曲线压倒了我的代码<>封闭式<<>>/代码>。

The desired behavior is that for the entire duration that the div is being controlled by the mouse, I want the cursor to remain the closedhand.

是否有办法在不修改中央安全局的情况下,将 mo改成everything,而 mo可能会转移吗? I Trial !important on :active 而这种风格却并非如此。

最佳回答

Answer / Question: What would happen if you had a duplicate div which sat on top of the grabscroll div, but which had no background or content of any type so as to not hide anything behind it, and then set the cursor hand on this.

z-index是否超越了这种方式的重要性?

Does this make sense?

事实上,你有 gr——但顿——在这个层秩序中不时的 gr。

问题回答

这个问题与制造“模式”方言箱非常相似,而且很可能有类似的解决办法: 我认为,在滚动期间,你必须创建<代码>iframe,置于你重新滚动的内容之上,使其在滚动期间在z-index次序上高于内容。 这是因为,在IE(至少)形式上,控制往往不服从z-index well,这就是为什么“光箱”式物品就是这样:iframe

Here s an answer I gave to another question here on SO which demonstrates the basics of the iframe shim. In that case it s for modal purposes, but the concept and most of the code would apply.





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签