<!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的更多相关文章

  1. jQuery插件初级练习5答案

    html: $.kafei.fontsize($("p"),"30px").html("123") jQuery: $.kafei={ fo ...

  2. jQuery插件初级练习5

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  3. jQuery插件初级练习4答案

    html: $("p").log().css("color","red") jQuery: $.fn.extend({ log: funct ...

  4. jQuery插件初级练习4

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  5. jQuery插件初级练习3答案

    html: $("p").fontcolor().html("qaq") jQuery: $.fn.extend({ fontcolor:function(){ ...

  6. jQuery插件初级练习3

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  7. jQuery插件初级练习2答案

    html: $.font($("p"),"30px").html("变化了") jQuery: $.extend({ font:functi ...

  8. jQuery插件初级练习2

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  9. jQuery插件初级练习1答案

    html: <script> $(".btn").click(function(){ $.color($("#box"),"blue&qu ...

随机推荐

  1. 使用Visual VM 查看linux中tomcat运行时JVM内存

    前言:在生产环境中经常发生服务器内存溢出,假死或者线程死锁等异常,导致服务不可用.我们经常使用的解决方法是通过分析错误日记,然后去寻找代码到底哪里出现了问题,这样的方式也许会奏效,但是排查起来耗费时间 ...

  2. andorid UI事件 监听器

    gridlayout.xml <?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns ...

  3. 简单使用DESeq2/EdgeR做差异分析

    简单使用DESeq2/EdgeR做差异分析 Posted: 五月 07, 2017  Under: Transcriptomics  By Kai  no Comments DESeq2和EdgeR都 ...

  4. CH6901 骑士放置

    原题链接 和棋盘覆盖(题解)差不多.. 同样对格子染色,显然日字的对角格子是不同色,直接在对应节点连边,然后就是二分图最大独立集问题. #include<cstdio> #include& ...

  5. Centos查公网IP地址

    [root@syy ~]# curl icanhazip.com 115.29.208.111

  6. Homestead 修改 Homestead.yaml 文件后 vagrant up 报错的问题

    一般情况是 TAB 和空格的问题. 虽然表面看来,缩进是一致的. 但是 TAB 没能替换为空格,从而导致问题. 解决: $ sudo vim /etc/vim/vimrc.local syntax o ...

  7. sqli盲注自用脚本

    盲注脚本 # -*- coding:utf-8 -*- import requests import re url = "http://123.206.87.240:8002/chengji ...

  8. c++11 时间相关操作练习

    博客和书籍资料 来自该地址 https://www.cnblogs.com/qicosmos/category/490693.html 自行编写相应代码进行学习 // TimeTest.cpp: 定义 ...

  9. Minimum Window Substring LT76

    Given a string S and a string T, find the minimum window in S which will contain all the characters ...

  10. python 函数调用顺序

    def foo(): print ('in the foo') bar() def bar(): print ('in the bar') foo() 1.foo函数进入内存 2.bar函数进入内存 ...