javascript 从 jquery UI 可调整大小的元素中删除句柄图像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10801676/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 11:04:24  来源:igfitidea点击:

Removing handle image from jquery UI resizable element

javascriptjqueryjquery-ui

提问by Gaurav

How can I remove the default southeast (se)handle imageof the resizable element and add my own image?

如何删除可调整大小元素的默认southeast (se)手柄图像并添加我自己的图像?

采纳答案by woz

You have two options:

您有两个选择:

  1. You can override ui-resizable-handleor ui-resizable-seas mentioned on the jQuery siteat the very bottom.
  2. You can alter the image file "ui-icons_222222_256x240.png", an example of which is hosted here, by Google.
  1. 您可以覆盖ui-resizable-handle或在最底部的 jQuery 站点ui-resizable-se提到。
  2. 您可以更改图像文件“ui-icons_222222_256x240.png”,其示例在此处托管,由 Google 提供

回答by vnpnlz

i always do this in my .css file

我总是在我的 .css 文件中这样做

.ui-dialog .ui-resizable-se {
    background-image: url("");
}

and it works all the time :)

它一直有效:)

回答by Jeff Pearce

You can also specify which handles you want in resizable(), e.g for just the "e" handle

您还可以在 resizable() 中指定您想要的句柄,例如仅用于“e”句柄

$("#id").resizable({
    handles: "e"
});

http://api.jqueryui.com/resizable/#option-handles

http://api.jqueryui.com/resizable/#option-handles

回答by user3596227

You can also work this out at 'create' option:

您也可以在“创建”选项中解决这个问题:

$('#element').resizable({
   create: function(event, ui) {
     $('.ui-icon-gripsmall-diagonal-se').remove();
   }
})

回答by SpYk3HH

inside the div with class ui-resizable, you need to replace the background image for the div with class ui-icon-gripsmall-diagonal-se

在带有 class 的 div 中ui-resizable,您需要用 class替换 div 的背景图像ui-icon-gripsmall-diagonal-se

You can do something like:

您可以执行以下操作:

$(".ui-icon-gripsmall-diagonal-se").css("background-image", "url(someImage.png)")

回答by Steven

The instructions in this post worked for me:

这篇文章中的说明对我有用:

http://forum.jquery.com/topic/how-to-make-the-se-grip-handle-larger-for-a-jquery-ui-resizeable

http://forum.jquery.com/topic/how-to-make-the-se-grip-handle-larger-for-a-jquery-ui-resizeable

Use this css:

使用这个css:

.ui-widget-content .ui-icon.ui-icon-gripsmall-diagonal-se {
      width: 32px;
      height: 32px;
      background: url(<insert your image url here>) left top no-repeat;
}

回答by Sanath Kumar

I hope this will work for you :

我希望这对你有用:

.ui-resizable-handle { 
    z-index: auto !important;
    background-image: url('');
 }

if u need to remove the handle-icon completely just set the background-image to none.

如果您需要完全删除手柄图标,只需将背景图像设置为无。

.ui-resizable-handle { 
    background-image: none;
 }

回答by rak3sh

$('.ui-icon-gripsmall-diagonal-se').css("background-image", "url('')");

回答by Vikneshwar

I removed the resize handle permanently altering the css like this:

我删除了调整大小的句柄,像这样永久改变了 css:

<style>
   .ui-icon, .ui-widget-content .ui-icon
   {
      background-image : none;
   }
</style>

It works for me.

这个对我有用。