jquery 设置css样式
$("#61dh a").css('color',
多个样式属性
var divcss = {
background: '#EEE',
width: '478px',
margin: '10px 0 0',
padding: '5px 10px',
border: '1px solid #CCC'
};
$("#result").css(divcss);
查看某个元素的css属性值。
$("#61dh a").css("color")
//和第一个例子相似,但是这里我们只传递一个参数(样式属性)
设置鼠标划过后的链接样式 定义两个函数,一个是鼠标划过时;另一个是鼠标划过后。具体方法如下:
$("#61dh a").css('color','#123456');
$("#61dh a").hover(function(){
$(this).css('color','#999');
},
function(){
$(this).css('color','#123456');
});
jquery 设置css样式的更多相关文章
- js和jquery设置css样式的几种方法
一.js设置样式的方法 1. 直接设置style的属性 某些情况用这个设置 !important值无效 element.style.height = '50px'; 2. 直接设置属性(只能用于某些 ...
- 关于jquery中用函数来设置css样式
关于jquery中用函数来设置css样式 2016-12-21 23:27:55 1.jquery语法 $(selector).css(name,function(index,value)) name ...
- 3.通过js代码设置css样式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 5、通过js代码设置css样式
1.页面 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...
- jquery操作CSS样式全记录
$(this).click(function(){ if($(this).hasClass(“zxx_fri_on”)){ $(this).removeClass(“zxx_fri_on”); ...
- jquery操作css样式的方法
jquery操作css样式的方法(设置和获取)
- DOM设置css样式
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- js设置css样式.
在js设置css样式做法 var obj = document.getElementById('div'); obj.style.width = '100px'; obj.style.height = ...
- JS设置CSS样式的几种方式
用JS来动态设置CSS样式,常见的有以下几种 1. 直接设置style的属性 某些情况用这个设置 !important值无效 如果属性有'-'号,就写成驼峰的形式(如textAlign) 如果想保 ...
随机推荐
- 登录界面 beta版
1.MainActivity.java package com.example.administrator.myapplication; import android.content.Intent; ...
- Java-基础编程(螺旋矩阵&乘法表)
package cn.rick.study; import java.io.BufferedReader;import java.io.InputStreamReader;import java.ut ...
- Android Volley 框架的使用(一)
为什么要使用Volley框架 开发android应用很多时候都要涉及网络操作,Android SDK中提供了HttpClient 和 HttpUrlConnection两种方式用来处理网络操作,但当应 ...
- UVALive 6508 Permutation Graphs
Permutation Graphs Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit ...
- Scanner
/* next()与nextLine()区别 next(): 1.一定要读取到有效字符后才可以结束输入. 2.对输入有效字符之前遇到的空白,next()方法会自动将其去掉. 3.只有输入有效字符后才将 ...
- Codeforces Round #250 (Div. 2)A(英语学习)
链接:http://codeforces.com/contest/437/problem/A A. The Child and Homework time limit per test 1 secon ...
- Codeforces Round #379 (Div. 2) C. Anton and Making Potions 二分
C. Anton and Making Potions time limit per test 4 seconds memory limit per test 256 megabytes input ...
- shell script数组使用函数输出
#!/bin/bash # array variable to function test function testit { local newarray newarray=("$@&qu ...
- mongoDB中的ID的生成原则
- ZOJ-3725 Painting Storages 动态规划
题意:给定一个数N,表示有N个位置,要么放置0,要么放置1,问至少存在一个连续的M个1的放置方式有多少? 分析:正面求解可能还要考虑到重复计算带来的影响,该题适应反面求解.设dp[i][j]表示到前 ...