Draggable Window
How do I make an draggable window?
I had an idea for using a draggable window and decided to test it here on CodePen. This should work on both mobile and desktop. I tested it on my GS3 and in Chrome.. What is a draggable window? How do you make a draggable window? This script and codes were developed by Charlie Volpe on 08 November 2022, Tuesday.
Draggable Window - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Draggable Window</title> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="drag" class="window ui-widget-content"> <div class="button red"></div> <div class="button yellow"></div> <div class="button green"></div> <div class="content"> <div class="header"> Draggable Window </div> <p class="paragraph"> Twee beard Intelligentsia jean shorts, Marfa gastropub High Life. Cliche synth fanny pack, shabby chic artisan kitsch Brooklyn messenger bag Bushwick farm-to-table selfies. Bicycle rights jean shorts banjo Intelligentsia deep v, next level disrupt direct trade brunch artisan vinyl mixtape. Slow-carb Marfa lomo, Truffaut stumptown wolf meh paleo swag. Street art Vice church-key jean shorts 8-bit fanny pack put a bird on it roof party. Salvia beard cred kogi. Echo Park asymmetrical Tumblr Williamsburg gentrify, salvia trust fund skateboard keytar locavore tattooed plaid. </p> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Draggable Window - Script Codes CSS Codes
body { background: #777;
}
.window { position: absolute; background: #e7e7e7; top: 10%; left: 10%; width: 50%; padding-top: 50%; border-radius: .5rem; cursor: pointer;
}
.button { position: absolute; top: 2%; width: 4.5%; padding-top: 4.5%; border-radius: 50%; box-shadow: inset 0 -1px 0 rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.7), 0 1px 0 rgba(255,255,255,1), 0 -1px 0 rgba(0,0,0,.1);
}
.red { background: #ff6260; left: 2%;
}
.red:hover { background: #ff3737;
}
.yellow { background: #f6c26c; left: 8%;
}
.yellow:hover { background: #f3de3e;
}
.green { background: #a8dd86; left: 14%;
}
.green:hover { background: #81eb3d;
}
.content { position: absolute; background: #f7f7f7; top: 8%; left: 1%; right: 1%; bottom: 1%; border-bottom-left-radius: .5rem; border-bottom-right-radius: .5rem; border: 1px solid #c7c7c7; padding: 1rem;
}
.header { position: relative; color: #474747; width: 100%; height: 2rem; line-height: 2rem; font-size: 2rem; text-align: center;
}
.paragraph { color: #474747; overflow: hidden; text-align: justify; width: 100%; height: 80%;
}
@media screen and (max-width: 38em) { html { font-size: 12px; }
}
@media screen and (max-width: 30em) { html { font-size: 8px; }
}
Draggable Window - Script Codes JS Codes
$(function(){ $('#drag').draggable();
});
Developer | Charlie Volpe |
Username | charlie-volpe |
Uploaded | November 08, 2022 |
Rating | 3 |
Size | 2,717 Kb |
Views | 16,192 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Grided Canvas Side-Scroller Game Engine | 4,366 Kb |
Block Puzzle Game | 5,895 Kb |
RGBA Long Form to Decimal Converter | 2,235 Kb |
Podshare | 1,977 Kb |
Header Line Issue | 1,768 Kb |
Galaxy S3 CSS Template | 2,704 Kb |
Animated Menu Circles | 2,410 Kb |
Heart Shaped Games Redesign | 3,767 Kb |
Layout Resolutions | 1,860 Kb |
Full Site Redesign | 4,238 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Box-sizing | Elad2412 | 1,572 Kb |
Pure CSS Tooltips | Mobius1 | 2,271 Kb |
HTML5 Video Autoplay | Zivcos | 1,352 Kb |
This in constructor context | _shree33 | 1,718 Kb |
Transition | Shayhowe | 1,632 Kb |
C.Rowe Button | Brownerd | 2,473 Kb |
Clock Face Idea | Chrisburnell | 3,196 Kb |
Sticky div | Kaslab | 2,225 Kb |
A Pen by Alex Edwards | Exards | 8,218 Kb |
Sexy Social Buttons | Ipiyale | 2,226 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!