JSFiddle - React, Tailwind, and code Playground
by Alexander Lashchevsky
HTML
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<div class="box">
<div class="box-close boxJS"><i class="fa fa-times-circle"></i></div>
<div class="box-head"><i class="fa fa-envelope"></i>Задать вопрос</div>
<div class="box-content">
<div class="box-ballon">Текст...</div>
<input class="box-input" type="text" placeholder="Первое поле"/>
<input class="box-input" type="text" placeholder="Второе поле"/>
<input class="box-input" type="text" placeholder="Третье поле"/>
<div class="box-buttonField">
<button class="box-button">Отправить</button>
</div>
</div>
</div>
<div class="boxJS button">
<div class="button-text">Задать вопрос</div>
</div>
CSS
* {
padding: 0;
margin: 0;
}
.box {
display: none;
position: fixed;
top: 50%;
margin-top: -200px;
right: 50px;
width: 310px;
height: 400px;
background: #fff;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.24), 0 5px 35px 0 rgba(0, 0, 0, 0.3);
font-family: lt-Roboto, Arial, Helvetica, sans-serif;
border-radius: 5px;
transition: right .4s;
}
.box:active {
cursor: move;
}
.box-close {
position: absolute;
top: 0;
right: -30px;
width: 30px;
height: 40px;
text-align: right;
font-size: 20px;
color: #008c00;
opacity: 0;
transition: opacity .15s;
}
.box-close:hover {
color: #000;
cursor: pointer;
}
.box:hover .box-close {
opacity: 1;
}
.box-head {
position: relative;
border-radius: 5px 5px 0 0;
font-size: 15px;
font-weight: 600;
line-height: 37px;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
text-align: center;
height: 37px;
letter-spacing: 0;
padding: 0 15px;
background-color: #008c00;
color: #ffffff;
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 80%);
background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 80%);
background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 80%);
background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 80%);
background-image: linear-gradient(top, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 80%);
}
.box-head:hover {
cursor: move;
}
.box-head i {
position: absolute;
top: 10px;
left: 15px;
opacity: 0.5;
}
.box-content {
padding: 15px;
overflow-y: auto;
}
.box-ballon {
position: relative;
font-size: 12px;
padding: 7px 10px;
text-align: left;
clear: both;
line-height: 18px;
vertical-align: top;
margin-bottom: 18px;
word-wrap: break-word;
...
JavaScript
$(function() {
$('.box').draggable();
$('.boxJS').click(function(){
$('.button').fadeToggle();
$('.box').fadeToggle();
});
});