怎么用jq点击上边蓝字导航的颜色框 变颜色? 在线等

本帖子已过去太久远了,不再提供回复功能。3036人阅读
&!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""&
&html xmlns=""&&head&&&& &title&&/title&&&& &style type ="text/css" &&&& .i{ background-color :B}&&& &/style&&&& &script src="jquery-1.5.1.min.js" type="text/javascript"&&/script&&&& &script type ="text/javascript" &&&&&&&& $(function() {&&&&&&&&&&& $("body input").focus(function() {&&&&&&&&&&&&&&& $(this).addClass("i");&&&&&&&&&&& }).blur(function() {&&&&&&&&&&&&&&& $(this).removeClass("i");&&&&&&&&&&& })&&&&&&& })&&& &/script&&/head&
&body&&input type ="text" /&&input type ="text" /&&input type ="button" value ="单击" /&&/body&&/html&
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:18892次
排名:千里之外
原创:20篇
(18)(1)(1)你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
自己用通用的模板修改了一下导航栏。
然后发现自己改的,鼠标点击之后颜色不变;代码说实话看不懂。麻烦大神帮忙看下。
&li&?php if ($_GET['sort_type'] == 'unresponsive') { ?& class=&active&&?php } ?&&&a href=&question/square/&?php if ($this-&feature_info) { ?&feature_id-&?php echo $this-&feature_info['id']; ?&__&?php } ?&category-&?php echo $this-&category_info['id']; ?&__sort_type-unresponsive&&&?php _e('等待回复'); ?&&/a&&/li&
&li&?php if ($_GET['sort_type'] == 'hot') { ?& class=&active&&?php } ?&&&a href=&question/square/category-1&& &?php _e('用户问题跟进'); ?&&/a&&/li&
代码里面没看到哪里设置颜色啊。。
该问题目前已经被锁定, 无法添加新回复
浏览: 2950
关注: 1 人电子商务教程子分类jQuery简单实现鼠标点击链接变色,文字变颜色_最火下载站
您的位置: >
> jQuery简单实现鼠标点击链接变色,文字变颜色
jQuery简单实现鼠标点击链接变色,文字变颜色
  jQuery简单实现鼠标点击链接变色,文字变颜色!鼠标点击第一个链接文字变色同时出现背景色,点下一个链接时,第一个链接恢复原来样式。
  为解决一些网页特效运行后不能显示效果(例如:jQuery则需要刷新)问题,烈火特别新增网页版演示。
  点击查看:
  运行演示:
&!DOCTYPE html&
&meta http-equiv=&Content-Type& content=&text/ charset=gbk&&
&title&点击链接变色,文字变色 - &/title&
&style type=&text/css&&
li{width:100height:20}
li.color{color:background:#}
&li&111&/li&
&li&222&/li&
&li&333&/li&
&li&444&/li&
&script type=&text/javascript& src=&/uploads/common/js/jquery-1.4.2.min.js&&&/script&
&script type=&text/javascript&&
$(function(){
$(&ul li&).click(function(){
$(this).addClass(&color&).siblings().removeClass();
&/html&&br /&&center&如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:&a href='/' target='_blank'&/&/a&&/center&提示:可修改后代码再运行!
上一篇: 下一篇:

我要回帖

更多关于 jq点击显示再点击隐藏 的文章

 

随机推荐