FCC-Front End Development jQuery
来源:互联网 发布:chm阅读器 for mac 编辑:程序博客网 时间:2024/05/03 12:11
知识点:
- jQuery只是用JavaScript写的一个库。
下面这个documet ready function实在网页被加载完成之后才会开始工作的。
$(document).ready(function() { });
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加上一个额外的类。$(".well").addClass("animated shake");
是给well类加动画效果,well前面有一个英文句号哦!而且所有的都用双引号!$("#target3").addClass("animated fadeout");
是给id为target3的元素加动画效果。- 有addClass当然也会有removeClass辣!使用方法目前看来是一致的。
- 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. - 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);
. 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");
jQuery has a function called .remove() that will remove an HTML element entirely .
- jQuery has a function called appendTo() that allows you to select HTML elements and append them to another element.
- 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. - jQuery has a function called parent() that allows you to access the parent of whichever element you’ve selected.
- jQuery has a function called children() that allows you to access the children of whichever element you’ve selected.
- 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");
- Another CSS selector: odd or even.
$(".target:odd").addClass("animated shake");
- FCC-Front End Development jQuery
- FCC-Front End Development HTML and CSS
- FCC-Front End Development Basic Projects
- FCC-Front End Development Responsive Design with Bootstrap
- front-end development 总结
- Front End Accessibility Development Guide
- Front End Progressive Enhancement Development
- front-end
- front end
- gcc front end
- C/C++ Front End
- C / C ++ front end
- Front-end Developer Handbook
- #Udacity#Front-end#Study_Note
- kotlin-cn front end
- code skills(front end)
- [Front-end] What makes a good front end engineer
- C/C++ Front End Compiler
- 证明题 8.10
- css三种书写格式以及import与link的区别
- 前端学习笔记--AJAX的使用(一)
- CSS之background-size属性
- 响应式编程总览
- FCC-Front End Development jQuery
- 新浪微博美女图片的爬虫
- (bzoj 2734 [HNOI2012]集合选数)<状压DP>
- VS静态编译
- Java8 方法引用-Method References
- C# 读取Access数据库及php读取服务器上的Access数据库
- hibernate工作流程
- 卷积神经网络的可解释性
- 黑色帽子