ModalWindow’s are pretty popular things these days. And they aren’t very difficult to do. In-fact, I would have to say that they are easier to do by hand, then to do by JavaScript inclusion. That could depend on how complex of a Modal Window you are trying to make, but take a look at the following script. The number of problems to solve are not that cumbersome. With this, you can click here and get a pop up modal window. You can also add the modal source yourself, that way you can configure whatever HTML you would like inside of it, in this particular example, I am using jQuery DOM manipulation because I have this setup as a plugin for another site that I am working on. Just tag the “modalClick” class to the link and Enjoy!
-
<script language="JavaScript" type="text/javascript">
-
$(function() {
-
$("#modalback").css("height", $("body").outerHeight());
-
$("#modalsource").css("top", $(window).height() / 2 – $("#modalsource").height() / 2);
-
$("#modalsource").css("left", $(window).width() / 2 – $("#modalsource").width() / 2);
-
-
$("#modalback").click(function() {
-
$("#modalback").fadeOut(‘fast’);
-
$("#modalsource").fadeOut(‘fast’);
-
});
-
$("#modalsource").click(function() {
-
$("#modalback").fadeOut(‘fast’);
-
$("#modalsource").fadeOut(‘fast’);
-
});
-
-
$(".modalClick").click(function() {
-
$("#modalsource").css("top", $(window).height() / 2 – $("#modalsource").height() / 2 + $("body").scrollTop());
-
$("#modalback").fadeIn(‘fast’);
-
$("#modalsource").fadeIn(‘fast’);
-
});
-
});
-
</script>


Facebook
Twitter
email
LinkedIn
It was bound to happen. It was projected in movies. It has been thought of in new business ventures. And the technology is getting very close to even more experimental use of Cybernetics. We haven’t quite tapped into the biological implants with every day to day applications and electronics, but we do have people beginning to implant bluetooth microphones in their ears as well as magnets in their wrists to give them some new edge on what today’s current trend is.
