JQueryMobile环境搭建

本文介绍了如何使用jQuery Mobile创建手机Web界面。从下载类库到引入文件,并通过示例代码展示了如何利用data-role属性布局界面。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

承蒙老师的启发,开始学习jQueryMobile知识。Write less,Do More.做手机web界面,绝对给力。

首先到http://jquerymobile.com/网站下载相应类库,如jquery.mobile-1.0a4.1.zip,jquery-ui-1.8.11.custom.zip。

根据官网上要求,引入相应文件。如图1,代码如下:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="jquery/jquery.mobile-1.0a4.1.min.css" />
<script src="jquery/jquery-1.5.1.min.js"></script>
<script src="jquery/jquery-ui-1.8.11.custom.min.js"></script>
<script src="jquery/jquery.mobile-1.0a4.1.min.js"></script>
<title>JQueryMobile</title>
</head>
<body>


<div data-role="page"id="home">

  <div data-role="header">
  <h1>WJGilmore, LLC</h1>
  </div>

  <div data-role="content">   
  <strong>Easy PHP Websiteswiththe Zend Framework</strong><br/>
  <p>
  <em>Easy PHP Websiteswiththe Zend Framework</em>isthe ultimate
  introductiontothe popular Zend Framework, covering practical topics
  including Doctrine, Zend_Db, Zend_Test, automated deployment,andmuch
  more!
  </p>
  </div>

  <div data-role="footer">
  <h1>Copyright ©2010W.J. Gilmore, LLC</h1>

  </div>

</body>
</html>

 

jQuery真的很强大啊,通过data-role 属性将可以为我们布局界面。

我是通过Opera Mobile for Windows 模拟器 ,模拟手机浏览器效果。如图2

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值