Home Web Front-end H5 Tutorial Xiaoqiang's HTML5 mobile development road (45) - Exchange rate calculator [1]

Xiaoqiang's HTML5 mobile development road (45) - Exchange rate calculator [1]

Feb 15, 2017 pm 01:25 PM

In the past two days, I have read "PhoneGap in Action" and there is an example of an exchange rate calculator. I personally think it is better, so I will share it with you. In the next few articles, we will complete this PhoneGap + Jquery together. A small exercise for mobile.

1. Create a new site in DrameWeaver, as shown in the figure:


##2. Write the exchange rate calculation page


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<!--引入相关样式框架-->
<link rel="stylesheet" href="css/jquery.mobile-1.0.1.min.css"/>
<script src="js/jquery.js"></script>
<script src="js/jquery.mobile-1.0.1.min.js"></script>
</head>
<body>
	<p data-role="page" id="index">
    	<p class="exchangeRates">
        <p class="header">
        	<p class="right">
            	<p class="right">
                	<a href="#setting" data-transition="slide"><img src="images/tm.gif" width="80" height="89" border="0"></a>
                </p>
            </p>
        </p>
        <p class="bg">
        	<p class="list">
            	<p class="currency">人民币</p>
                <p class="money"><input type="number" id="c1" maxlength="12" value="0"/></p>
            </p>
        	<p class="list">
            	<p class="currency">美元</p>
                <p class="money strong"><input type="number" id="c2" maxlength="12" value="0"/></p>
            </p>
        	<p class="list">
            	<p class="currency">日元</p>
                <p class="money strong"><input type="number" id="c3" maxlength="12" value="0"/></p>
            </p>
        	<p class="list">
            	<p class="currency">里尔</p>
                <p class="money strong"><input type="number" id="c4" maxlength="12" value="0"/></p>
            </p>
        	<p class="list">
            	<p class="currency">新加坡元</p>
                <p class="money strong"><input type="number" id="c5" maxlength="12" value="0"/></p>
            </p>
            <p class="list">
            	<p class="currency">欧元</p>
                <p class="money strong"><input type="number" id="c6" maxlength="12" value="0"/></p>
            </p>
            <p class="list">
            	<p class="currency">克朗</p>
                <p class="money strong"><input type="number" id="c7" maxlength="12" value="0"/></p>
            </p>
            <p class="list">
            	<p class="currency">英镑</p>
                <p class="money strong"><input type="number" id="c8" maxlength="12" value="0"/></p>
            </p>          
        </p>
    </p>
    <p data-role="page" id="setting">
    	<p class="setRates">
        
        </p>
    </p>
</body>
</html>
Copy after login

This interface is still very unsightly, let’s design the style

Introduce the style file:


<link rel="stylesheet" href="css/style.css"/>
Copy after login

Add header style:


/* CSS Document */
body{
	background-color:#c19e7d;
	font-family:"黑体";
	margin:0px;
	padding:0px;
}

/*
1.text-align:center 设置文本或img标签等一些内联对象(或与之类似的元素)的居中。
2.margin:0 auto 设置块元素(或与之类似的元素)的居中。
*/

.exchangeRates,.setRates{
	width:480px; 
	height:100%;
	margin:0 auto;
	font-family:"黑体";	
}

.header{
	width:480px;	
	height:116px;
	background:url(../images/title.png) no-repeat;
}

.header .right{ 
	float:right;
	width:80px;
	height:54px;
}
.header .right a{
	float:right;
	width:80px;
	height:54px;	
}
.header .right a:hover{
	float:left;
	width:80px;
	height:54px;	
	background:url(../images/setting.png) no-repeat;
}
Copy after login

Add list style:


.bg{
	width:480px;
	height:598px;
	background:url(../images/bg.png) no-repeat;
	background-color:#999933;
	overflow:hidden;
}

.bg .list{
	float:left;
	width:480px;
	height:77px;
	background:url(../images/line.png) 0px 64px no-repeat;	
}

.bg .list .currency{
	float:left;
	width:150px;
	height:77px;
	text-align:left;
	font-size:28px;
	line-height:50px;
	color:#bea58c;
	padding-left:30px;
}

.bg .list .money{ 
	float:left; 
	width:240px;
	height:77px; 
	text-align:right; 
	font-weight:bold; 
	line-height:50px; 
	color:#ffefda;
	padding-top:3px;
}
.bg .list .money input{
	float:right; 
	background-color:transparent; 
	width:210px; 
	height:25px;
	border:0px; 
	font-size:30px; 
	color:#ffefda; 
	font-family:Arial, Helvetica, sans-serif;
	padding-left:6px; 
	padding-right:6px; 
	text-align:right;
}

.strong{ font-weight:bold}

.footer{
	width:480px; 
	height:49px; 
	background:url(../images/bottom.png) no-repeat;
}
Copy after login

The above is the content of Xiaoqiang’s HTML5 mobile development road (45) - Exchange Rate Calculator [1]. For more related content, please pay attention to the PHP Chinese website (www.php .cn)!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles