html active属性
源代码
<div class="col-md-3">
<div class="list-group">
<a href="{{ url_for('home.user') }}" class="list-group-item active">
<span class="glyphicon glyphicon-user"></span> 会员中心
</a>
<a href="{{ url_for('home.pwd') }}" class="list-group-item">
<span class="glyphicon glyphicon-lock"></span> 修改密码
</a>
<a href="{{ url_for('home.comments') }}" class="list-group-item">
<span class="glyphicon glyphicon-comment"></span> 评论记录
</a>
<a href="{{ url_for('home.loginlog') }}" class="list-group-item">
<span class="glyphicon glyphicon-calendar"></span> 登录日志
</a>
<a href="{{ url_for('home.moviecol') }}" class="list-group-item">
<span class="glyphicon glyphicon-heart"></span> 收藏电影
</a>
</div>
</div>
更换选项 active激活项不变
修改:
1.增加id
2.去掉active
3.在相应页面添加jquery事件
<div class="col-md-3">
<div class="list-group">
<a id = "m-1" href="{{ url_for('home.user') }}" class="list-group-item ">
<span class="glyphicon glyphicon-user"></span> 会员中心
</a>
<a id = "m-2" href="{{ url_for('home.pwd') }}" class="list-group-item">
<span class="glyphicon glyphicon-lock"></span> 修改密码
</a>
<a id = "m-3" href="{{ url_for('home.comments') }}" class="list-group-item">
<span class="glyphicon glyphicon-comment"></span> 评论记录
</a>
<a id = "m-4" href="{{ url_for('home.loginlog') }}" class="list-group-item">
<span class="glyphicon glyphicon-calendar"></span> 登录日志
</a>
<a id = "m-5" href="{{ url_for('home.moviecol') }}" class="list-group-item">
<span class="glyphicon glyphicon-heart"></span> 收藏电影
</a>
</div>
</div>
<script>
$(document).ready(function () {
$("#m-1").addClass("active");
})
</script>
html active属性的更多相关文章
- iOS Web开发激活css的active伪类
最近在做一个资讯客户端,用到UIWebview展示一些网页内容,本来想做一个简单的按压效果,发现在css中设置active属性一直不管用. 查阅了一下资料,今天发现,要让css active伪类生效, ...
- CSS.02 -- 样式表 及标签分类(块、行、行内块元素)、CSS三大特性、背景属性
样式表书写位置 内嵌式写法 <head> <style type="text/css"> 样式表写法 </style> </head&g ...
- spring程序打包war,直接通过-jar启动,并指定spring.profiles.active参数控制多环境配置
备注:spring boot有内嵌tomcat,jar项目可以用java -jar命令启动,war包也可以,且可以直接指定spring.profiles.active参数控制多环境配置 直接指定传参, ...
- attr prop jquery关于获取DOM属性值的两个函数
$('#domid').attr('acitve') $('#domid').prop('checked') // 在使用JQUERY获取DOM元素的属性时,有两个函数,attr 和 prop < ...
- Spring Boot学习记录03_一些属性配置文件
转自:http://blog.didispace.com/springbootproperties/ 多环境配置(这个地方跟maven的profile配置有点类似) 我们在开发Spring Boot应 ...
- CSS基础以及属性
一.CSS 偷个懒,啥是CSS我就不介绍啦 二.CSS语法 CSS语法:选择符{属性:属性值:属性:属性值:}选择符表示要定义样式的对象,可以是元素本身,也可以是一类元素或者制定名称的元素.属性:属性 ...
- 深入理解Spring Boot属性配置文件
我们在开发Spring Boot应用时,通常同一套程序会被应用和安装到几个不同的环境,比如:开发.测试.生产等.其中每个环境的数据库地址.服务器端口等等配置都会不同,如果在为不同环境打包时都要频繁修改 ...
- Spring Boot属性配置文件详解
相信很多人选择Spring Boot主要是考虑到它既能兼顾Spring的强大功能,还能实现快速开发的便捷.我们在Spring Boot使用过程中,最直观的感受就是没有了原来自己整合Spring应用时繁 ...
- python 全栈开发,Day48(标准文档流,块级元素和行内元素,浮动,margin的用法,文本属性和字体属性)
昨日内容回顾 高级选择器: 后代选择 : div p 子代选择器 : div>p 并集选择器: div,p 交集选择器: div.active 属性选择器: [属性~='属性值'] 伪类选择器 ...
随机推荐
- MVC Filter中加入验证并跳转
public class BuildingFilter : ActionFilterAttribute { /// <summary> /// 验证 Building Cookie add ...
- FineReport9.0定义数据连接(创建与SQL Server 2016数据库的连接)
1.下载并安装好FineReport9.0和SQL Server 2016 2.开始——>所有应用——>Microsoft SQL Server 2016——>SQL Server ...
- ubuntu sudo: pip:找不到命令
编辑文件 /etc/sudoers sudo vi /etc/sudoers 将Defaults env_reset ,改为 Defaults !env_reset 编辑文件-/.bashers ...
- rabbitmq系列四 之路由
1.路由 在上一个的教程中,我们构建了一个简单的日志记录系统.我们能够向许多接收者广播日志消息. 在本次教程中,我们向该系统添加一些特性,比如,我只需要严重错误(erroe级别)的部分日志打印到磁盘文 ...
- SQLite使用入门
什么是SQLite SQLite是一款非常轻量级的关系数据库系统,支持多数SQL92标准.SQLite在使用前不需要安装设置,不需要进程来启动.停止或配置,而其他大多数SQL数据库引擎是作为一个单独的 ...
- 再学Java 之 foreach循环
从Java 5 之后,Java提供了一种新的循环:foreach循环,这种循环遍历数组和集合更加简洁. foreach循环语法格式如下: for ( type variableName : array ...
- 网络游戏程序员须知 UDP vs TCP(转)
本文为作者原创或翻译,转载请注明,不得用于商业用途. 作者:rellikt@gmail.com 首发链接:http://blog.csdn.net/rellikt/archive/2010/08/21 ...
- Java后台 解析JSON的几个方法
1.对象转JSON对象. public static void main(String[] args) { Domain demo = new Domain( "在线JSON校验格式化工具 ...
- 2-nginx 安装
1, nginx简介: •Nginx("engine x") 是一个高性能的HTTP 和反向代理服务器,也是一个IMAP/POP3/SMTP 代理服务器.•第一个公开版本0.1.0 ...
- php的error_log()记录日志
<?php date_default_timezone_set('PRC');//设置时区,否则会有警告 //把This s a error保存到/home/log-yyyy-MM-dd.txt ...