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 属性选择器: [属性~='属性值'] 伪类选择器 ...
随机推荐
- 前端 day 30 html 基础一
前情提要: html基础一 一:html标签入门 1: 1 HTML结构 1)一个html文件有且只有一个html标签.这个就是HTML的根标签.2)一个HTML文件主要由两部分组成:文件头和文件体. ...
- POJ 1298
#include<iostream>// chengdacaizi 注释!2008 11 05 #include<string> using namespace std; in ...
- 剑指offer五十六之删除链表中重复的结点
一.题目 在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针. 例如,链表1->2->3->3->4->4->5 处理后 ...
- HttpComponents组件探究 - HttpClient篇
在Java领域,谈到网络编程,可能大家脑海里第一反应就是MINA,NETTY,GRIZZLY等优秀的开源框架.没错,不过在深入探究这些框架之前,我们需要先从最original的技术探究开始(当然,需要 ...
- dubbo学习(1)--简单的入门搭建实例
转载请注明源文出处:http://www.cnblogs.com/lighten/p/6828026.html 1 简介 dubbo是一个分布式服务框架,由阿里巴巴的工程师开发,致力于提供高性能和透明 ...
- Vue路由router-link的使用
Vue路由router-link的使用 相关Html: <!DOCTYPE html> <html lang="en"> <head> < ...
- MongoDB运行状态、性能监控,分析
转载自这位仁兄:地址 mongostat详解 mongostat是mongdb自带的状态检测工具,在命令行下使用.它会间隔固定时间获取mongodb的当前运行状态,并输出.如果你发现数据库突然变慢或者 ...
- CSS3中的pointer-events
今天做项目中偶然误把元素加上了pointer-events属性,结果导致后来在js中给该元素加点击事件不能用,检查了半天才发现是这个属性的问题.之前没有好好研究,于是决定仔细研究一下. 一.定义及语法 ...
- JavaScript -- Constructor、Prototype
----- 012-constructor.html ----- <!DOCTYPE html> <html> <head> <meta http-equiv ...
- Chapter 3 Phenomenon——10
It took six EMTs and two teachers — Mr. Varner and Coach Clapp — to shift the van far enough away fr ...