<!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. spring boot (一): Hello World

    什么是spring boot Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人员 ...

  2. RNA测序相对基因表达芯片有什么优势?

    RNA测序相对基因表达芯片有什么优势? RNA-Seq和基因表达芯片相比,哪种方法更有优势?关键看适用不适用.那么RNA-Seq适用哪些研究方向?是否您的研究?来跟随本文了解一下RNA测序相对基因表达 ...

  3. 洛谷4054 [JSOI2009]计数问题

    原题链接 二维树状数组模板题. 对每一种颜色开一棵二维树状数组统计即可. #include<cstdio> using namespace std; const int N = 310; ...

  4. Django报错:__init__() missing 1 required positional argument: 'on_delete'

    原因: 在django2.0后,定义外键和一对一关系的时候需要加on_delete选项,此参数为了避免两个表里的数据不一致问题,不然会报错:TypeError: __init__() missing ...

  5. windows无法停止 服务 错误1053 服务没有及时响应

    windows无法停止 服务 错误1053 服务没有及时响应 服务程序.exe -st

  6. Linux设置桌面图标 (双击运行jar包)

    Ubuntu平台 预备条件: 1)平台是Gridion上的Ubuntu 2)安装了JRE (版本如下) 3)在IDE(我用的是IDEA)打包成可运行的jar文件 设置步骤: 1)新建.desktop文 ...

  7. Spring IOC(三)单例 bean 的注册管理

    Spring IOC(三)单例 bean 的注册管理 Spring 系列目录(https://www.cnblogs.com/binarylei/p/10198698.html) 在 Spring 中 ...

  8. sql 用Group by分组后,取每组的前几条记录

    转自:http://blog.163.com/jeson_lwj/blog/static/135761083201052411115783/ --查询每门课程的前2名成绩 CREATE TABLE S ...

  9. CSS学习笔记:盒子模型

    盒子模型(CSS basic box model):When laying out a document, the browser's rendering engine represents each ...

  10. 【转】再讲IQueryable<T>,揭开表达式树的神秘面纱

    [转]再讲IQueryable<T>,揭开表达式树的神秘面纱 接上篇<先说IEnumerable,我们每天用的foreach你真的懂它吗?> 最近园子里定制自己的orm那是一个 ...