小编And*_*csi的帖子

jQuery显示/隐藏不起作用

我有一个基本的HTML页面,包含一些JS和CSS:

$('.expand').click(function() {
  $('.img_display_content').show();
});
Run Code Online (Sandbox Code Playgroud)
@charset "utf-8";

/* CSS Document */

.wrap {
  margin-left: auto;
  margin-right: auto;
  width: 40%;
}

.img_display_header {
  height: 20px;
  background-color: #CCC;
  display: block;
  border: #333 solid 1px;
  margin-bottom: 2px;
}

.expand {
  float: right;
  height: 100%;
  padding-right: 5px;
  cursor: pointer;
}

.img_display_content {
  width: 100%;
  height: 100px;
  background-color: #0F3;
  margin-top: -2px;
  display: none;
}
Run Code Online (Sandbox Code Playgroud)
<html>

<head>
  <link href="beta.css" rel="stylesheet" type="text/css" />
  <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
</head>

<body>
  <div class="wrap">
    <div class="img_display_header">
      <div class="expand">+</div>
    </div>
    <div class="img_display_content"></div>
  </div> …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

21
推荐指数
2
解决办法
9万
查看次数

标签 统计

css ×1

html ×1

javascript ×1

jquery ×1