Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 30th, 2014, 05:55 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert jQuery to javascript

Code:
<style>
	.msgBox{
		position:absolute;
		z-index:10;
		border-radius:5px;
		border:1px solid #F5F5F5;
		background-color:#DDD;
		box-shadow:1px 1px 5px #999;
		overflow:hidden;
		display:none}
	.msgBox ul, .msgBox li{
		list-style:none;
		padding:0;
		margin:0;
		border:0}
		.msgBox .title{
			border-bottom:#AAA solid 1px;
			padding:5px;
			background-color:#CCC;
			font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
			font-weight:bold;
			text-shadow:1px 1px #DDD;
			font-size:12px}
		.msgBox .msgContent{
			border-top:#F5F5F5 solid 1px;
			padding:5px;
			text-shadow:1px 1px #F1F1F1;
			font-family:Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
			font-size:12px}
		.msgBox .ok{
			text-shadow:1px 1px #F1F1F1;
			font-family:Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
			font-size:12px;
			margin:0 auto 5px auto;
			width:20px;
			padding:4px 5px 4px 5px;
			background-color:#CCC;
			text-align:center;
			cursor:pointer;
			transition:all 300ms linear;
			border:#DDD solid 1px;
			box-shadow:0 0 1px #AAA;
			border-radius:4px}
		.msgBox .ok:hover{
			background-color:#EEE}	
</style>
<div class="msgBox">
	<ul class="title">Alert</ul>
    <ul class="msgContent">No messege</ul>
    <ul>
        <li class="ok">Ok</li>
    </ul>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script language="javascript">
// Upgraded confirm function
var msgBox = function(msg){
	var w =$(document).width(),
		h = $(document).height();
	var msgW = $('.msgBox').width(),
		msgH = $('.msgBox').height();
	$('.msgBox').css({left:(w-msgW)/2, top:(h-msgH)/2});
	$('.msgBox')
		.show()
		.find('.msgContent').text(msg);
	$('.msgBox').find('.ok').click(function(){
		$('.msgBox').hide();
	});
	$(document).keyup(function(event){
		if(event.which==13){
			$('.msgBox').hide();
		}
	});
}
msgBox('Enter your message!');
</script>
Demo: http://www.yepi3games.org/alert.htm
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 11 jQuery unobtrusive javascript stopped the ShowMessageBox AlanWheeler BOOK: Beginning ASP.NET 4.5 : in C# and VB 9 March 6th, 2014 07:19 AM
XMPP senior programming javascript and jquery login user name is Chinese can not logi 2591349@qq.com BOOK: Professional XMPP Programming with JavaScript and jQuery 0 January 19th, 2013 03:08 AM
Get the displying content from the div using javascript or jquery thava BOOK: Beginning HTML, XHTML, CSS, and JavaScript 0 January 23rd, 2012 04:26 AM
Convert an algorithm to JavaScript mikky21 Javascript How-To 7 May 16th, 2011 10:48 AM
JavaScript vs JQuery skijor ASP.NET 3.5 Basics 4 August 7th, 2009 10:21 AM



All times are GMT -4. The time now is 07:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.