jQuery框架的简单使用(H5)

<!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">
© by 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)的更多相关文章
- 使用dom元素和jquery元素实现简单增删改的练习
软件开发实际就是数据的增删改查,javascript前端开发也不例外.今天学了jquery框架的简单使用.于是用它实现简单的增删改,接着也用原始的javascript实现同样的功能,以便看出jquer ...
- jQuery系列 第一章 jQuery框架简单介绍
第一章 jQuery框架简单介绍 1.1 jQuery简介 jQuery是一款优秀的javaScript库(框架),该框架凭借简洁的语法和跨平台的兼容性,极大的简化了开发人员对HTML文档,DOM,事 ...
- jQuery框架开发一个最简单的幻灯效果
在线演示 在这个课程中,我们将介绍如何使用jQuery来开发一个最简单的图片幻灯效果. 立刻观看互动课程:jQuery框架开发一个最简单的幻灯效果 阅读原文:jQuery框架开发一个最简单的幻灯效果
- jQuery框架-2.jQuery操作DOM节点与jQuery.ajax方法
一.jQuery操作DOM 内部插入操作: append(content|fn):向每个匹配的元素内部追加内容. prepend(content):向每个匹配的元素内部前置内容. 外部插入操作: af ...
- jQuery系列 第四章 jQuery框架的选择器
第四章 jQuery框架的选择器 4.1 jQuery选择器说明 jQuery 最核心的组成部分就是选择器引擎.它完全继承了 CSS 的风格,可以对 DOM 元 素的标签名.属性名.状态等进行快速准确 ...
- jQuery系列 第八章 jQuery框架Ajax模块
第八章 jQuery框架Ajax模块 8.1 jQuery框架中的Ajax简介 Ajax技术的核心是XMLHTTPRequest对象,该对象是Ajax实现的关键,发送异步请求.接收服务器端的响应以及执 ...
- jQuery系列 第七章 jQuery框架DOM操作
第七章 jQuery框架的选择器 jQuery框架继承和优化了JavaScript访问DOM对象的特性,我们使用jQuery框架提供的api可以更加方便的操作DOM对象. 7.1 创建DOM节点 使用 ...
- jQuery系列 第六章 jQuery框架事件处理
第六章 jQuery框架事件处理 JavaScript以事件驱动来实现页面的交互,其核心是以消息为基础,以事件来驱动.虽然利用传统的JavaScript事件处理方式也能够完成页面交互,但jQuery框 ...
- jQuery系列 第五章 jQuery框架动画特效
第五章 jQuery框架动画特效 5.1 jQuery动画特效说明 jQuery框架中为我们封装了众多的动画和特效方法,只需要调用对应的动画方法传递合适的参数,就能够方便的实现一些炫酷的效果,而且jQ ...
随机推荐
- Git Shell使用笔记
1,首次打开Git shell错误(以前打开过gethub客户端) 警告: git command could not be found. Please create an alias or add ...
- PHP 防止表单重复提交
原理是:首先在表单页生成一个 随机不重复的 token(可以利用时间戳),把 token 的值分别存入 session 和 表单的隐藏域:当提交表单的时候,在接收页对比传递过来的 token 和ses ...
- adId、idfv
//广告标示符,适用于对外:例如广告推广,换量等跨应用的用户追踪等. NSString *adId = [[[ASIdentifierManager sharedManager] advertisin ...
- [SHELL进阶] (转)最牛B的 Linux Shell 命令 (四)
1.查看ASCII码表 man 7 ascii 很多人初学编程都会接触到ascii码的概念,有时候为了查某个符号的ascii值,可能还得翻箱倒柜找出当年的课本?Linux Manpage里面其实包含 ...
- 用正则表达式替换html标签
下面的代码用于修改html文本中的img标记,修改后的html适用于lazyload方式的图片加载: protected string LazyPicProcess(string content) { ...
- Oracle 数据库安装
下载 www.oracle.com ->Downloads -> Oracle Database 安装: 解压到同一文件夹下 仅安装数据库软件 单实例数据库安装 企业版 oracle基目录 ...
- 【转】Java 5种字符串拼接方式性能比较。
最近写一个东东,可能会考虑到字符串拼接,想了几种方法,但对性能未知,于是用Junit写了个单元测试. 代码如下: import java.util.ArrayList; import java.uti ...
- Linux Bluetooth内核分析
目录 1. 初始化 2. hci部分 Linux提供了对Bluetooth的支持,核心代码位于net/bluetooth 1. 初始化 主要由subsys_initcall调用函数bt_init()来 ...
- BLE-NRF51822教程-RSSI获取
当手机和设备连接上后,设备端可以通过获取RSSI,在一定程度上判断手机离设备的相对距离的远近. 获取函数很简单直接调用sd_ble_gap_rssi_get 接口函数就行了,传入连接句柄和buff就能 ...
- ios 消息传递机制
引用文章 一.KVO 1.当对象中的某个属性值发生了改变,可以对这些值的观察者做出通知. 2.接受者(会接收到值发生改变的消息) 必须知道发送者(值将发生改变的那个对象). 3.接收者同样还需要知道发 ...