【问题标题】:How to make draggable transparent?如何使可拖动透明?
【发布时间】:2016-05-08 02:44:21
【问题描述】:

我想知道如何使可拖动的透明。目前背景是白色的。这是我的网站: http://amp.site88.net/

这是我的代码:

<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Draggable - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
#draggable { width: 150px; height: 150px; padding: 0.5em; }
 </style><style>
 body {
background-color: lightblue;
}
</style>
<script>
$("#draggable").css("background-color", "transparent");
</script>
<script>
$(function() {
$( "#draggable" ).draggable();
});
</script>
</head>
 <body>

 <div id="draggable" class="ui-widget-content">
 <p>Drag me around</p>
</div>


 </body>
 </html>

【问题讨论】:

    标签: jquery css draggable


    【解决方案1】:

    只需编辑您的样式块:

        #draggable { width: 150px; height: 150px; padding: 0.5em; background: transparent; }
    

    它应该可以工作:)

    PS。如果您还希望边框消失,只留下文本,则可能需要添加 border: none;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-23
      • 1970-01-01
      • 1970-01-01
      • 2017-10-02
      相关资源
      最近更新 更多