( ! ) Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in D:\www\up\jQuery\jquery_07.php on line 20 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0000 | 355992 | {main}( ) | ...\jquery_07.php:0 |
( ! ) Warning: include(http://pub.houheaven.com/Nav02/Nav_deep2.htm): failed to open stream: no suitable wrapper could be found in D:\www\up\jQuery\jquery_07.php on line 20 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0000 | 355992 | {main}( ) | ...\jquery_07.php:0 |
( ! ) Warning: include(): Failed opening 'http://pub.houheaven.com/Nav02/Nav_deep2.htm' for inclusion (include_path='.;C:\php\pear') in D:\www\up\jQuery\jquery_07.php on line 20 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0000 | 355992 | {main}( ) | ...\jquery_07.php:0 |
$(content).addClass(class)
如果预先在css文件中设定好了样式,就可以通过添加类来改变元素样式。
如果想要添加两个样式,需要用空格进行分隔,如:$(content).addClass("Class01 Class02")
删除一个:$(content).removeClass(class)
删除多个:$(content).removeClass("Class01 Class02")
var strbool=$(selector).hasClass(class);
返回值:布尔类型。
$(content).toggleClass(class)
$(content).toggleClass(class,switch)
如果元素忠含有class属性,则删除;否则添加。表达式switch为真,则追加,为假,则删除。
var count=1;
$("p#one").click(function(){$(this).toggleClass("Red");});
$("p#two").click(function(){$(this).toggleClass("Red",count++%3==0);});
$(content).css(name);
$(content).css(properties);
$(content).css(key,value);
属性 | 说明 |
---|---|
name | 获取属性值:指定属性名来获取其属性值 |
properties | 设定属性值:书写方式为{属性名:"值",属性名:"值"…},可以设置多个属性 |
key,value | 设置属性值:key为属性名,value为属性值,两者都必须用双引号火单引号括起来 |
[ 后天堂向上 | 好好学习天天向上 ]