jQuery插件初级练习1
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/jquery-1.11.0.js" ></script> //jQuery必备
<script type="text/javascript" src="js/demo10.js" ></script> //根据自己的js包名更改
<style>
#box{
width: 50px;
height: 50px;
border: 1px solid black;
}
</style>
</head>
<body>
<button class="btn">按钮</button>
<div id="box">
</div>
<script>
/*
利用jquery对象编写一个插件color,让#box背景颜色发生改变,并且可以实现连缀
例如:
$.color($("#box"),"blue").html("变化")
$.color($("#box"),"yellow").html("变化")
$.color($("#box"),"black").html("变化")
*
*
*
* */
</script>
</body>
</html>
jQuery插件初级练习1的更多相关文章
- jQuery插件初级练习5答案
html: $.kafei.fontsize($("p"),"30px").html("123") jQuery: $.kafei={ fo ...
- jQuery插件初级练习5
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- jQuery插件初级练习4答案
html: $("p").log().css("color","red") jQuery: $.fn.extend({ log: funct ...
- jQuery插件初级练习4
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- jQuery插件初级练习3答案
html: $("p").fontcolor().html("qaq") jQuery: $.fn.extend({ fontcolor:function(){ ...
- jQuery插件初级练习3
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- jQuery插件初级练习2答案
html: $.font($("p"),"30px").html("变化了") jQuery: $.extend({ font:functi ...
- jQuery插件初级练习2
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- jQuery插件初级练习1答案
html: <script> $(".btn").click(function(){ $.color($("#box"),"blue&qu ...
随机推荐
- Android.Tools.Ant
ant 1. ant手册翻译 ant手册翻译是一项大工程!!!!!! ant在线手册的链接好不明确. 2. ant 支持for循环 安装ant-contrib Ref[1.1]. 要在ant的buil ...
- Java Swing 中使用 EventQueue
public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { ...
- Eclipse 安装使用 M2Eclipse 插件
help --> Install New Software --> Add 安装完后需要重启eclipse 通常 Eclipse 会自带 Maven.但可能按自己安装的 Maven 存在版 ...
- 无法嵌入互操作类型"ESRI.ArcGIS.Carto.MapDocumentClass".请改用适用的接口
在对地图文档进行操作时,居然出现如下问题: IMapDocument m_MapDocument = new ESRI.ArcGIS.Carto.MapDocumentClass(); 报错: 无法嵌 ...
- js模态框实现原理
<!DOCTYPE> <html> <head> <style>/* 定义模态对话框外面的覆盖层样式 */ #modal-overlay { visib ...
- NETSHARP的JAVA开发环境配置
一:JAVA配置 1. netsharp使用java1.8/1.7版本,本文使用1.8版本 2.jdk下载地址:http://www.oracle.com/technetwork/java/javas ...
- java中HashMap的基本方法使用
遍历,添加词,等等 package test; import java.util.HashMap; import java.util.Iterator; import java.util.ArrayL ...
- 一波水题 MZOJ 1035: 贝克汉姆
#include <bits/stdc++.h> using namespace std; ; int n,m; int v[N],w[N],f[N]; int main() { scan ...
- Java往hbase写数据
接上篇读HDFS 上面读完了HDFS,当然还有写了. 先上代码: WriteHBase public class WriteHBase { public static void writeHbase( ...
- 将爬取的网页数据保存到数据库时报错不能提交JPA,Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\xB6 \xE2...' for column 'content' at row 1
错误原因:我们可以看到错误提示中的字符0xF0 0x9F 0x98 0x84 ,这对应UTF-8编码格式中的4字节编码(UTF-8编码规范).正常的汉字一般不会超过3个字节,为什么为出现4个字节呢?实 ...