<div class="wrap-box flex_row">
<div class="wrap-block">
<div class="wrap-b">
<div class="wrap-bit"></div>
<img class="wrap_img" src="data:images/temp/pic_240x240.png" alt="" />
<p class="wrap_p">刀塔传奇</p>
</div>
</div>
<div class="wrap-block">
<div class="wrap-b">
<div class="wrap-bit"></div>
<img class="wrap_img" src="data:images/temp/pic_240x240.png" alt="" />
<p class="wrap_p">李小龙:进入比赛</p>
</div>
</div>
<div class="wrap-block">
<div class="wrap-b">
<div class="wrap-bit"></div>
<img class="wrap_img" src="data:images/temp/pic_240x240.png" alt="" />
<p class="wrap_p">刀塔传奇</p>
</div>
</div>
<div class="wrap-block">
<div class="wrap-b">
<div class="wrap-bit"></div>
<img class="wrap_img" src="data:images/temp/pic_240x240.png" alt="" />
<p class="wrap_p">刀塔传奇</p>
</div>
</div>
<div class="wrap-block">
<div class="wrap-b">
<div class="wrap-bit"></div>
<img class="wrap_img" src="data:images/temp/pic_240x240.png" alt="" />
<p class="wrap_p">刀塔传奇</p>
</div>
</div>
<div class="wrap-block">
<div class="wrap-b">
<div class="wrap-bit"></div>
<img class="wrap_img" src="data:images/temp/pic_240x240.png" alt="" />
<p class="wrap_p">刀塔传奇</p>
</div>
</div>
</div>

css部分:

.wrap-box{width:100%;display: flex;justify-content: space-around;align-items: flex-end;flex-wrap: wrap;border-bottom:1px solid #cecfd9;background-color:#fff;}
.wrap-block{width:33.33%;height:auto;border-top:1px solid #cecfd9;border-left:1px solid #cecfd9;}
.wrap-block:nth-child(3n-2){border-left:0 none;}
.wrap-block .wrap-b{width:100%;height:100%;position:relative;}
.wrap-block .wrap-b .wrap-bit{display:none;position:absolute;right:;top:;z-index:;width:20rem;height:20rem;background:url(../images/wrap-bitimg.png) no-repeat;background-size:cover;}
.wrap-block.active .wrap-b .wrap-bit{display:block;}
.wrap-block .wrap-b .wrap_img{display:block;width:80%;height:80%;margin:0 auto;padding:10% 0 0;}
.wrap-block .wrap-b .wrap_p{margin-bottom:8%;font-size:3rem;color:#666;line-height:5rem;height:5rem;text-align:center;overflow:hidden;}

js部分:

<script>
$(document).ready(function(){
$('wrap-block').click(function(){
$(this).toggleClass('active').siblings('.wrap-block').removeClass('active');
})
}) </script>

同类型元素,只有一个被选中js的更多相关文章

  1. 自己写一个swap函数交换任意两个相同类型元素的值 对空指针的使用 字节大小的判断(二)了解原理

    验证的代码: #include <stdio.h> int main(){ char c = 'z'; ) + (c << ) + () + 'a'; printf(" ...

  2. 《剑指Offer》第20题(Java实现):定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数(时间复杂度应为O(1))。

    一.题目描述 定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数(时间复杂度应为O(1)). 二.思路解析 首先定义一个Integer类型的栈,记为stack,此栈用来完成数据 ...

  3. 剑指offer20:定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数(时间复杂度应为O(1))。

    1 题目描述 定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数(时间复杂度应为O(1)). 2. 思路和方法 利用辅助栈来存储现有栈的最小值.在入栈和出栈的时候将现有栈和最小 ...

  4. js中实现截取数组的后几个元素作为一个新数组的方法

    有时候我们会遇到这种需求,截取数组中后5个元素作为一个新数组,且顺序不能变.数组中的slice()方法和splice()方法都可以实现这样的操作. const arr = [1,2,7,2,6,0,3 ...

  5. 仿照jquery封装一个自己的js库(一)

    所谓造轮子的好处就是复习知识点,加深对原版jquery的理解. 本文系笔者学习jquery的笔记,记述一个名为"dQuery"的初级版和缩水版jquery库的实现.主要涉及知识点包 ...

  6. 一个demo学会js

    全栈工程师开发手册 (作者:栾鹏) 快捷链接: js系列教程1-数组操作全解 js系列教程2-对象和属性全解 js系列教程3-字符串和正则全解 js系列教程4-函数与参数全解 js系列教程5-容器和算 ...

  7. 仿照jquery封装一个自己的js库

    所谓造轮子的好处就是复习知识点,加深对原版jquery的理解.本文系笔者学习jquery的笔记,记述一个名为"dQuery"的初级版和缩水版jquery库的实现.主要涉及知识点包括 ...

  8. Javascript JQuery获取当前元素的兄弟元素/上一个/下一个元素(转)

    var chils= s.childNodes; //得到s的全部子节点 var par=s.parentNode; //得到s的父节点 var ns=s.nextSbiling; //获得s的下一个 ...

  9. 分享一个基于 Node.js 的 Web 开发框架 - Nokitjs

    简介 Nokit 是一个简单易用的基于 Nodejs 的 Web 开发框架,默认提供了 MVC / NSP / RESTful 等支持,并提供对应项目模板.管理工具. 资源 GitHub https: ...

随机推荐

  1. node.js 入门

    什么是Node.js?还服务器端javascript?对于这个概念我在这篇文章不做解释,可以自己去搜索了解下,服务器端js不是新技术,只是最近的node.js的火爆让他爆发了,我会在以后的文章里解释什 ...

  2. selenium-webdriver 中执行js代码

    #获取标签的text文本值 js1="return document.getElementById('key1').innerText" dr.execute_script(js1 ...

  3. python time与datetime.date/datetime模块

    https://docs.python.org/3/library/datetime.html 1.用于日期比较大小的方法 方法名 方法说明 用法 __eq__(…) 等于(x==y) x.__eq_ ...

  4. 《数据结构(C#语言描述)》

    本文转载自abatei,数据结构学了很多次,但是只是知道硬性的概念,现在专攻C#语言,对编程语言也有了更深的认识, 买一本C#的数据结构来看看,再一次加深对数据结构的学习,真是一件让人高兴的事. 当当 ...

  5. B. No Time for Dragons(贪心)

    B. No Time for Dragons time limit per test 2.0 s memory limit per test 256 MB input standard input o ...

  6. 安装IntelliJ IDEA 破解安装

    IDEA 功能介绍 1-深度智力 IntelliJ IDEA为您的源代码编制索引后,通过在每个环境中提供相关建议,提供快速,智能的体验:即时和智能的代码完成,即时代码分析和可靠的重构工具. 2-开箱即 ...

  7. SVN中分支的建立与合并

    转载    出处:http://yaozhong1988.blog.163.com/blog/static/141737885201162671635126/ 一.  SVN分支的意义:     简单 ...

  8. Java源码之Object

    本文出自:http://blog.csdn.net/dt235201314/article/details/78318399 一丶概述 JAVA中所有的类都继承自Object类,就从Object作为源 ...

  9. Hosts文件的位置

    Operating System Version(s) Location Unix, Unix-like, POSIX   /etc/hosts Microsoft Windows 3.1 %WinD ...

  10. 中文Ubuntu里用户目录里的路径改成英文

    (附注:转载于http://www.linuxdiyf.com/linux/201105/56.html) 为了使用起来方便,装了Ubuntu中文版,自然在home文件里用户目录的"桌面&q ...