Skip to content

Instantly share code, notes, and snippets.

@spheregenomics
Created February 8, 2013 13:27
Show Gist options
  • Select an option

  • Save spheregenomics/4739040 to your computer and use it in GitHub Desktop.

Select an option

Save spheregenomics/4739040 to your computer and use it in GitHub Desktop.
Having some problems with jqueryUI and CSS.
#overlay {
bottom: 0;
display: none;
left: 0;
margin-right: auto;
margin-left: auto;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 100;
}
#blanket {
background-color: white;
bottom: 0;
display: block;
opacity: 0.8;
position: absolute;
top: 0;
width: 100%;
}
.dialog {
background: white;
border-radius: 10px;
display: none;
margin: 100px auto;
position: relative;
width: 700px;
height: 2000px;
padding: 40px;
border: 1px solid #F7F5F5;
box-shadow: 0 2px 20px rgba(34, 25, 25, 0.5);
}
$(document).ready(function(){
$('#dialogOpen').click(function() {
console.log("link clicked");
openDialog('#dialog');
});
$('#dialog').find('.ok')
.on('click', function() {
console.log("ok clicked");
closeDialog(this);
})
});
function openDialog(selector) {
$(selector)
.clone()
.appendTo('#overlay')
.show()
.parent()
.fadeIn('fast');
}
function closeDialog(selector) {
$(selector)
.parents('#overlay')
.fadeOut('fast', function() {
$(this)
.find('.dialog')
.remove();
});
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Far Away</title>
<link rel="stylesheet" href="dialog.css" media="screen" />
<script src="../lib/jquery-1.7.1.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<h4>
<a href="#" id="dialogOpen">Far, far away.</a>
</h4>
<p>
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then
</p>
<img src="http://placehold.it/600x900&amp;text=Image" />
<p>
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then
</p>
<!-- the dialog contents -->
<div id="overlay">
<div id="blanket"></div>
</div>
<div id="dialog" class="dialog">
<a href="#" class="ok">Close Dialog</a>
<div>
<h4 class="media-heading">Far, far away.</h4>
<p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane..<>
<p></p>
<div class="well">
<input class="input-xxlarge" type="text" placeholder="What do you think?" /><br />
<button />My Thoughts
</div>
</div>
</div>
<legend>
</legend>
<div class="media">
<div class="media-body">
<p> A long comment of several paragraphs. Comments do not have the heading line.<br />
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.<br /><br />
Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.
</p>
</div>
</div>
</div>
<!-- dialog -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment