jq-- CSS 盒模型
来源:互联网 发布:ansible控制windows 编辑:程序博客网 时间:2024/05/21 13:54
css()
$(‘div').css(‘width’,’100px’) 设置单一样式比较简单的写法
可以连写 $(‘div’).css(‘width’,’100px’).css(‘height’,’100px’).attr(…..)
$(‘div').css({width:'100px',height:'100px',backgroundColor:’red'}); 设置多个样式的时候;
addClass()添加class样式 $('div').addClass('style1');
removeClass()移除class样式
toggleClass() 两套样式来回切换
attr() 设置或获取标签的属性 $("img").attr({ src: "test.jpg", alt: "Test Image" });
$("img").attr("src","test.jpg");
$("img").attr("title", function(){
return this.src
});
直接把css换成animate就有动画了
$(selector).animate(styles,speed,easing,callback) 第三个参数默认是swing,还有一个内置值linear 使用插件提供更多easing函数
$('#div1').animate({width:400,height:'400','},2000,'linear',function(alert('d');) 当然这里需要注意:只有数字值才可以创建动画,字符串是不可以的
轮播图 swiperjs
JQ的插件 jquery easing
盒模型:
width() --就是content的宽度;
innerWidth() -- content+padding
height()--innerHeight()
outerHeight()--括号中不包括参数的时候:content+padding+bording;
outerWidth()
outerHeight(true)--括号中写上参数true的时候:content+padding+bording+margin
outerWidth(true)
offset(),这个返回的是一个对象,里面有一些我们需要的属性,比如--offset().left
- jq-- CSS 盒模型
- jq+css
- CSS、CSS盒模型
- jq css属性操作
- 下拉菜单(css、jq)
- CSS盒模型
- 什么是css盒模型?
- CSS 盒模型
- CSS盒模型讲解
- CSS 盒模型
- CSS盒模型
- div+css盒模型
- css 盒模型
- css盒模型组成
- css盒模型组成
- css的盒模型
- 介绍CSS盒模型
- CSS盒模型
- Android开发源码,绝对干货
- AST抽象语法树
- 利用迭代器遍历
- AOS 自动生成代码(三) Service生成
- javax.servlet.jsp.PageContext cannot be resolved to a type
- jq-- CSS 盒模型
- C++命名空间两种用法
- sui mobile打开链接 重新加载 兼容jq
- Unreal 蓝图 鼠标点击一个物体
- 仿支付宝输入支付密码2(带动画)
- Unity3D for VR 学习(4): 自绘摄像机的视口区域锥体
- PHP调用java写的webservice
- POJ3678
- 16年Android自学之路开始