JSFiddle - React, Tailwind, and code Playground
by fredd man
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tailwind CSS Full Screen Modal</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css" rel="stylesheet">
<style>
.modal {
transition: opacity 0.25s ease;
}
body.modal-active {
overflow-x: hidden;
overflow-y: visible !important;
}
.opacity-95 {opacity: .95;}
</style>
</head>
<body class="bg-gray-900 flex items-center justify-center h-screen">
<!-- DRAGABLE 3 -->
<!-- Draggable DIV -->
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<div id="mydiv5" class="js_zoom_and_pan">
<div id="mydivheader5">Click Aqui para mover</div>
<script>
(function() {
function touchHandler(e) {
var touches = e.changedTouches;
var first = touches[0];
var type = "";
switch(e.type) {
case "touchstart":
type = "mousedown";
break;
case "touchmove":
type="mousemove";
break;
case "touchend":
type="mouseup";
break;
default:
return;
}
var simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);
first.target.dispatchEvent(simulatedEvent);
e.preventDefault();
}
function init() {
document.addEventListener("touchstart", touchHandler, true);
document.addEventListener("touchmove", touchHandler, true);
document.addEventListener("touchend", touchHandler, true);
document.addEventListener("touchcancel", touchHandler, true);
}
init();
})();
(function($) {
$.fn.drags = function(opt) {
opt = $.extend({handle:"",cursor:"move"}, opt);
if(opt.handle === "") {
var $el = this;
} else {
var $el = this.find(opt.handle);
}
return $el.css('cursor', opt.cursor).on("mousedown", function(e) {
...