FCC-Front End Development jQuery

本文介绍了jQuery的基础用法,包括选择HTML元素、添加或移除CSS类、改变元素样式、操作元素属性及文本、克隆和移除元素等。还介绍了如何使用jQuery的父元素和子元素选择器,并利用CSS选择器来定位特定元素。

知识点:

  1. jQuery只是用JavaScript写的一个库。
  2. 下面这个documet ready function实在网页被加载完成之后才会开始工作的。

    $(document).ready(function() {
     });
  3. Now let’s write our first jQuery statement. All jQuery functions start with a $, usually referred to as a dollar sign operator, or as bling.jQuery often selects an HTML element with a selector, then does something to that element.For example, let’s make all of your button elements bounce. Just add this code inside your document ready function:$("button").addClass("animated bounce");注意标签名要用双引号包括起来,addClass就是给所有的button加上一个额外的类。

  4. $(".well").addClass("animated shake"); 是给well类加动画效果,well前面有一个英文句号哦!而且所有的都用双引号!
  5. $("#target3").addClass("animated fadeout");是给id为target3的元素加动画效果。
  6. 有addClass当然也会有removeClass辣!使用方法目前看来是一致的。
  7. jQuery has a function called .css() that allows you to change the CSS of an element.Here’s how we would change its color to blue:$("#target1").css("color", "blue");. The CSS property and its value are in quotes, and separated with a comma instead of a colon.
  8. jQuery has a function called .prop() that allows you to adjust the properties of elements.Here’s how you would disable all buttons:$("button").prop("disabled", true);.
  9. jQuery function:text(), that only alters text without adding tags. jQuery has a function called .html() that lets you add HTML tags and text within an element. Any content previously within the element will be completely replaced with the content you provide using this function, for example:

    $("#target4").html("<em>#target4</em>");
    $("#target2").text("hi");
  10. jQuery has a function called .remove() that will remove an HTML element entirely .

  11. jQuery has a function called appendTo() that allows you to select HTML elements and append them to another element.
  12. jQuery has a function called clone() that makes a copy of an element.For example, if we wanted to copy not replace “target2” to “#right-well”, we would use:$("#target2").clone().appendTo("#right-well"); This is called function chaining and it’s a convenient way to get things done with jQuery.
  13. jQuery has a function called parent() that allows you to access the parent of whichever element you’ve selected.
  14. jQuery has a function called children() that allows you to access the children of whichever element you’ve selected.
  15. jQuery uses CSS Selectors to target elements. target:nth-child(n) css selector allows you to select all the nth elements with the target class or element type.Here’s how you would give the third element in each well the bounce class:$(".target:nth-child(3)").addClass("animated bounce");
  16. Another CSS selector: odd or even.$(".target:odd").addClass("animated shake");
源码链接: https://pan.quark.cn/s/7b9e1590db2e 在本计划中,我们聚焦于一个基于数字逻辑的药片装瓶系统的构建,这构成了北京邮电大学(北邮)在小学期内向学生提供的一次课程设计课题。该系统致力于模拟实际药品包装的操作流程,借助电子操控和自动化技术达成药片的高效且精准的装瓶目标。以下是对该系统设计所涉及的关键知识领域的详尽阐述: 1. **数字逻辑**:数字逻辑是电子工程领域的核心学科,主要探究如何运用二进制数字进行信息的表征与处理。在此项目中,数字逻辑用于构建和实现系统的控制机制,诸如计数器、编码器、解码器、触发器等,旨在保障药片装瓶过程的精确调控。 2. **硬件电路构建**:系统可能整合微控制器、传感器、执行机构等硬件单元。例如,微控制器作为系统的心脏,负责接收输入信号,处理数据,并指挥执行机构执行药片装填。传感器负责监测药片的数量和瓶装进度,而执行机构如电机则负责实际完成装瓶动作。 3. **计数器**:在药片装瓶的操作过程中,计数器用于追踪已装入瓶子的药片总数,确保达到预设的剂量标准。这可能需要设计同步计数器或异步计数器,以实现精确计数并触发装瓶操作。 4. **编码与解码**:编码器将特定的信息(例如药片种类或剂量)转化为二进制编码,便于硬件设备进行处理;解码器则将这些编码解读为可执行的操作,如切换装瓶路径或启动封盖流程。 5. **触发器**:在系统中,触发器可用于在特定条件达成时启动或中止某个操作,例如当瓶子达到满载时关闭装填机制。 6. **传感器技术**:可能包含重量传感器、光电传感器或机械触碰开关,用于识别瓶子的存在、位置以及药片的数量。这些传感器的精确度直接关联到整个系统的性能水平。 7. **控制算法**...
内容概要:本文针对孤岛微电网在遭受拒绝服务(DoS)攻击下的安全与稳定运行问题,提出了一种基于混合系统理论的弹性二次控制策略,创新性地将动态事件触发机制与DoS攻击防御进行协同设计。该方法在保障微电网电压、频率恢复及有功功率精确均分的同时,有效应对通信链路被恶意阻塞的安全威胁,实现了控制性能与通信资源利用效率的双重优化。通过Simulink仿真平台与Matlab代码实现,验证了所提策略在复杂网络攻击场景下的鲁棒性与有效性,深入分析了系统稳定性条件及攻击容忍边界,为电力信息物理系统(CPS)在面临网络安全挑战时的可靠控制提供了理论依据和技术路径。; 适合人群:具备电力系统自动化、分布式控制或网络安全等相关专业背景,熟悉Matlab/Simulink仿真环境,从事微电网控制、信息物理系统安全或弹性控制研究的研究生、科研人员及工程技术人员。; 使用场景及目标:① 提升高比例分布式能源接入背景下孤岛微电网在通信受限与网络攻击耦合场景下的运行可靠性与弹性恢复能力;② 实现低通信开销下的分布式协同控制,优化资源利用并增强系统抗干扰性能;③ 为电力系统中安全-控制联合设计提供可复现的仿真模型与技术方案,推动安全防护从被动响应向主动容忍转变。; 阅读建议:读者应结合文中提供的Matlab代码与Simulink模型开展仿真实验,重点理解动态事件触发机制的设计原理及其与混合系统稳定性分析的融合方法,建议延伸学习DoS攻击建模、弹性控制理论及相关安全性证明技术,以全面掌握该协同设计框架的核心思想与实现细节。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值