view raw
johndoe johndoe - 1 year ago 81
Javascript Question

make draggable transparent >

i would like to know how to make a draggable transparent by default its white this is my website

this is my code

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

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



Just edit your style block:

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

and it should work :)

PS. you might have to add border: none; if you also want the border to disappear, leaving just the text.