简体   繁体   English

在div后面留下黑点

[英]Make black dot behind around div

I implemented Spectrum Color Picker . 我实现了Spectrum Color Picker There is a slight change I want to make. 我想做一个小小的改变。 The black dot that you can drag to select a color, the class name is sp-dragger . 可以拖动以选择颜色的黑点,类名是sp-dragger I want to edit the source file so that when you drag the black dot all the way to the side, (top, right, bottom and left side,) anything from the border of the class name sp-color and on, should hide the black dot. 我想编辑源文件,以便当您将黑点一直拖到侧面(顶部,右侧,底部和左侧)时,从类名sp-color和on的边框开始,应该隐藏黑点。

在此输入图像描述

(Image is from Adobe Illustrator) (图片来自Adobe Illustrator)

I think the way to do this would be to create a div, or use an existing div, and make the z-index higher than the black dot. 我认为这样做的方法是创建一个div,或使用现有的div,并使z-index高于黑点。

JSFiddle 的jsfiddle

JavaScirpt Source JavaScirpt Source

CSS Source CSS来源

Look for this part in the css source: 在css源代码中查找此部分:

.sp-color {
    position: absolute;
    top:0;
    left:0;
    bottom:0;
    right:20%;

   /* Then add this line */
   overflow: hidden;
}

So the content doesn't bleed outside its edge. 所以内容不会超出其优势。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM