JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>POC - On demand textarea</title>
</head>
<body>
<div>
<a id='activator' title='Click' href='#editor'>Click me</a>
</div>
<form id='editorForm' action=''>
<div id='editor'>
<textarea id='theText' rows='10' cols='10' disabled=''>sadasdg</textarea>
</div>
<input name='theValue' type='HIDDEN' value='sadasdg'>
<script type='text/javascript' language='JavaScript'>
<!--
$(document).ready (function () {
$("#editor").hide();
$("#activator").fancybox({
autoSize : false,
height : 300,
width : 400,
type : 'inline',
title : "Ihre Bemerkungen",
beforeLoad : function () {
var dbText = $("form.#editorForm > input[name='theValue']").val();
$("#theText").val(dbText);
$("#editor").show();
},
afterShow : function () {
$("#theText").focus();
},
afterClose : function () {
var editorText = $("#theText").val();
$("form.#editorForm > input[name='theValue']").val(editorText);
}
});
});
// -->
</script>
</form>
</body>
</html>
CSS
/*! fancyBox v2.0.5 fancyapps.com | fancyapps.com/fancybox/#license */
.fancybox-tmp iframe, .fancybox-tmp object {
vertical-align: top;
padding: 0;
margin: 0;
}
.fancybox-wrap {
position: absolute;
top: 0;
left: 0;
z-index: 1002;
}
.fancybox-outer {
position: relative;
padding: 0;
margin: 0;
background: #f9f9f9;
color: #444;
text-shadow: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.fancybox-opened {
z-index: 1003;
}
.fancybox-opened .fancybox-outer {
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.fancybox-inner {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
position: relative;
outline: none;
overflow: hidden;
}
.fancybox-error {
color: #444;
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
margin: 0;
padding: 10px;
}
.fancybox-image, .fancybox-iframe {
display: block;
width: 100%;
height: 100%;
border: 0;
padding: 0;
margin: 0;
vertical-align: top;
}
.fancybox-image {
max-width: 100%;
max-height: 100%;
}
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
background-image: url('fancybox_sprite.png');
}
#fancybox-loading {
position: fixed;
top: 50%;
left: 50%;
margin-top: -22px;
margin-left: -22px;
background-position: 0 -108px;
opacity: 0.8;
cursor: pointer;
z-index: 1010;
}
#fancybox-loading div {
width: 44px;
height: 44px;
background: url('fancybox_loading.gif') center center no-repeat;
}
.fancybox-close {
position: absolute;
top: -18px;
right: -18px;
width: 36px;
height: 36px;
cursor: pointer;
z-index: 1004;
}
.fancybox-nav {
position: absolute;
top: 0;
width: 40%;
height: 100%;
cursor:...
JavaScript
/*!
* fancyBox - jQuery Plugin
* version: 2.0.5 (21/02/2012)
* @requires jQuery v1.6 or later
*
* Examples at http://fancyapps.com/fancybox/
* License: www.fancyapps.com/fancybox/#license
*
* Copyright 2012 Janis Skarnelis - janis@fancyapps.com
*
*/
(function (window, document, $) {
var W = $(window),
D = $(document),
F = $.fancybox = function () {
F.open.apply( this, arguments );
},
didResize = false,
resizeTimer = null,
isMobile = typeof document.createTouch !== "undefined";
$.extend(F, {
// The current version of fancyBox
version: '2.0.5',
defaults: {
padding: 15,
margin: 20,
width: 800,
height: 600,
minWidth: 100,
minHeight: 100,
maxWidth: 9999,
maxHeight: 9999,
autoSize: true,
autoResize: !isMobile,
autoCenter : !isMobile,
fitToView: true,
aspectRatio: false,
topRatio: 0.5,
fixed: !($.browser.msie && $.browser.version <= 6) && !isMobile,
scrolling: 'auto', // 'auto', 'yes' or 'no'
wrapCSS: 'fancybox-default',
arrows: true,
closeBtn: true,
closeClick: false,
nextClick : false,
mouseWheel: true,
autoPlay: false,
playSpeed: 3000,
preload : 3,
modal: false,
loop: true,
ajax: { dataType: 'html', headers: { 'X-fancyBox': true } },
keys: {
next: [13, 32, 34, 39, 40], // enter, space, page down, right arrow, down arrow
prev: [8, 33, 37, 38], // backspace, page up, left arrow, up arrow
close: [27] // escape key
},
// Override some properties
index: 0,
type: null,
href: null,
content: null,
...