<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>作业</title>
<!--导入jQuery框架-->
<script src="jQuery/jquery-3.1.0.min.js"></script>
<script src="javascript/index.js" type="text/javascript"></script>
<link href="css/index.css" type="text/css" rel="stylesheet"/>
</head>
<body> <div id="bground">
<div class="time">
<button class="start">开始</button>
<button class="stop">停止</button>
<div class="count">0</div>
</div>
<div class="content">
<div class="left">
<button class="btn">x</button>
</div>
<div class="center">
<h3>静夜思</h3>
<p>床前明月光,</p>
<p>疑是地上霜。</p>
<p>举头望明月,</p>
<p>低头思故乡。</p>
</div>
<div class="right">
<img src="data:images/内网通截图20161110180030.png"/>
<button class="button">x</button>
</div>
</div> <div id="bm">
&copy; by&nbsp;&nbsp;&nbsp;LF
</div>
</div> </body>
</html>
body{
background-color: deepskyblue;
} #bground{
/*background: yellow;*/
position: relative;
height: 1000px;
width: 100%;
}
#bground .content{
/*background: red;*/
position: relative;
height: auto;
}
#bground .count{
/*background: white;*/
margin-left: 10px;
margin-top: 15px;
text-align: center;
font-size: 65px;
color: red;
width: 100px;
height: 60px;
line-height: 50px; } #bground .content .left{
background-color: deeppink;
position: relative;
/*opacity: 0.5;*/
display: inline-block;
width: 150px;
height: 300px;
left: 30px;
top: 200px;
} #bground .content .left button{
position: absolute;
right: 2px;
top: 2px;
} #bground .content .center{
background: greenyellow;
position: absolute;
display: inline-block;
width: 300px;
height: 600px;
/*margin-top: 50px;
margin-left: 22%;*/
left: 35%;
top: 50px;
text-align: center; } #bground .content .center h3{
/*background: red;*/
padding-top: 60px;
} #bground .content .right{
display: inline-block;
position: fixed;
right: 10px;
top: 120px;
width: 120px;
height: 200px;
} #bground .content .right img{
width: 100%;
height: 100%;
} #bground .content .right button{
position: absolute;
left: 2px;
top: 2px;
} #bground #bm{
background-color: chocolate;
position: absolute;
opacity: 0.8;
left: 25%;
bottom: 50px;
width: 50%;
height: auto;
text-align: center; }
/*
* jQuery的简单使用
*/
$(document).ready(function(){
/*
* $('.btn')获取类名为btn的标签
* click()为点击事件
*/
$('.btn').click(function(){
//隐藏标签
$('.btn').hide('slow');
// 慢慢淡出直达消失
$('.left').fadeOut('slow'); }) $('.button').click(function(){
$('.button').hide('slow');
// 标签往上收直到消失
$('.right').slideUp('slow');
})
// 设置定时器
var interval = setInterval("countFuntion()",1000); $('.start').click(function(){ if(interval ){
clearInterval(interval);
interval = null; }
interval = setInterval(countFuntion,1000);
// 定时器执行的方法
function countFuntion(){
var num = $('.count').html();
num ++;
$('.count').html(num);
}
}); /*
* 停止定时器
*/
$('.stop').click(function(){ if(interval){
clearInterval(interval);
interval = null;
}
});
});

jQuery框架的简单使用(H5)的更多相关文章

  1. 使用dom元素和jquery元素实现简单增删改的练习

    软件开发实际就是数据的增删改查,javascript前端开发也不例外.今天学了jquery框架的简单使用.于是用它实现简单的增删改,接着也用原始的javascript实现同样的功能,以便看出jquer ...

  2. jQuery系列 第一章 jQuery框架简单介绍

    第一章 jQuery框架简单介绍 1.1 jQuery简介 jQuery是一款优秀的javaScript库(框架),该框架凭借简洁的语法和跨平台的兼容性,极大的简化了开发人员对HTML文档,DOM,事 ...

  3. jQuery框架开发一个最简单的幻灯效果

    在线演示 在这个课程中,我们将介绍如何使用jQuery来开发一个最简单的图片幻灯效果. 立刻观看互动课程:jQuery框架开发一个最简单的幻灯效果 阅读原文:jQuery框架开发一个最简单的幻灯效果

  4. jQuery框架-2.jQuery操作DOM节点与jQuery.ajax方法

    一.jQuery操作DOM 内部插入操作: append(content|fn):向每个匹配的元素内部追加内容. prepend(content):向每个匹配的元素内部前置内容. 外部插入操作: af ...

  5. jQuery系列 第四章 jQuery框架的选择器

    第四章 jQuery框架的选择器 4.1 jQuery选择器说明 jQuery 最核心的组成部分就是选择器引擎.它完全继承了 CSS 的风格,可以对 DOM 元 素的标签名.属性名.状态等进行快速准确 ...

  6. jQuery系列 第八章 jQuery框架Ajax模块

    第八章 jQuery框架Ajax模块 8.1 jQuery框架中的Ajax简介 Ajax技术的核心是XMLHTTPRequest对象,该对象是Ajax实现的关键,发送异步请求.接收服务器端的响应以及执 ...

  7. jQuery系列 第七章 jQuery框架DOM操作

    第七章 jQuery框架的选择器 jQuery框架继承和优化了JavaScript访问DOM对象的特性,我们使用jQuery框架提供的api可以更加方便的操作DOM对象. 7.1 创建DOM节点 使用 ...

  8. jQuery系列 第六章 jQuery框架事件处理

    第六章 jQuery框架事件处理 JavaScript以事件驱动来实现页面的交互,其核心是以消息为基础,以事件来驱动.虽然利用传统的JavaScript事件处理方式也能够完成页面交互,但jQuery框 ...

  9. jQuery系列 第五章 jQuery框架动画特效

    第五章 jQuery框架动画特效 5.1 jQuery动画特效说明 jQuery框架中为我们封装了众多的动画和特效方法,只需要调用对应的动画方法传递合适的参数,就能够方便的实现一些炫酷的效果,而且jQ ...

随机推荐

  1. mongodb 手动分片的命令汇总

    手动分片的操作 自动分片会带来性能的下降. 所以要合理使用手动分片. 并且配合Tag一起使用. # 对于4个shard的程序, 预先处理的指令1. 加入分片服务器sh.addShard( " ...

  2. HTTP 笔记与总结(2 )HTTP 协议的(请求行的)请求方法 及 (响应行的)状态码

    (请求行的)请求方法 包括: GET,POST,HEAD,PUT,TRACE,DELETE,OPTIONS 注意:这些请求方法虽然是 HTTP 协议规定的,但是 Web Server 未必允许或支持这 ...

  3. IE6 — 你若安好,便是晴天霹雳 [ 乱弹 ]

    为什么还有人在用IE6?估计和中国的盗版业有很大关系吧.小白的电脑启不来了,请人重装系统,一张古老的Ghost搞定,IE6便落地生根.今天碰到一例报告说某网站在IE6下丑陋吓人,无心无力去解决,于是来 ...

  4. 获取android设备的IP

    public class IPAddressUtils { public static String getLocalIpAddress() { try { String allIP = " ...

  5. GitHub超详细图文攻略

    GitHub超详细图文攻略 - Git客户端下载安装 GitHub提交修改源码工作流程 Git 分类: 转载2014-03-25 21:10 10641人阅读 评论(2) 收藏 举报 GitHubbr ...

  6. LR网页细分图中的时间详解

    Web Page Diagnostics: 1)DNS Resolution:浏览器访问一个网站的时候,一般用的是域名,需要dns服务器把这个域名解析为IP,这个过程就是域名解析时间,如果我们在局域网 ...

  7. regardless of how many processors are devoted to a parallelized execution of this program

    https://en.wikipedia.org/wiki/Amdah's_law Amdahl's law is often used in parallel computing to predic ...

  8. word size

    Computer Systems A Programmer's Perspective Second Edition Running throughout the system is a collec ...

  9. Delphi Application.MessageBox详解

    引数:1. Text:要显示的讯息2. Caption:讯息视窗的标题列文字3. Flags:讯息旗标     3.1. 可指定讯息视窗上的图示     3.2. 可指定讯息视窗出现的按钮     3 ...

  10. 【转】CodeIgniter定义自己的Helper和Helper的方法

    最近做程序,采用了PHP+CodeIgniter框架,总体来说这框架很轻而且上手也很快的. 首先,说下如何定义自己的Helper,个人理解helper其实就是定义函数方法. 如果要建个全新的自己的He ...