jquery查找ul属性不是hide,jQuery的ul显示/隐藏功能

I'm trying to hide my divs which will have content in them when finished. I have a jsFiddle file and some of the coding is not complete, just wrote it very fast to give you an idea.

I believe that the ul is making it not be created correctly.

解决方案

The html in your fiddle is invalid: you should not assign the same id attribute to multiple elements. If you try to do something like $("#slidingDiv").hide(); it will only select the first (in most browsers) element with that id to hide.

Also you are using the ".show_hide" class selector but none of your elements have that class.

Within your click handler you've said $(this).next("#slidingDiv").slideToggle(); but the .next() method doesn't go looking for the next element that has the supplied id, it selects only the immediately following element if that element has the supplied id.

Also you've used jsfiddle incorrectly: within the JavaScript window you are supposed to put JavaScript code, not tags. You should remove the tags and instead select the required library from the panel on the left, like this: http://jsfiddle.net/vCZC7/1/ (Your fiddle had the default Mootools library selected on the left.)

I found your explanation of the required behaviour somewhat lacking, but here is a working fiddle where clicking the li elements toggles the divs underneath: http://jsfiddle.net/vCZC7/3/ (note: I updated it to use the latest jQuery because the simplest thing seemed to be to use the .index() method syntax introduced in version 1.4 and you had only included 1.3.2).

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/428542.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

HttpContext

相关知识点:ttp://www.cnblogs.com/wujy/p/3264475.htmlHttpContext context HttpContext.Current; if( context ! null ) {// 在这里访问与请求有关的东西。 } 记录当前用户信息的线程当前线程是指与【当前请求】相关的线程。在ASP.NET中,有些线程并非…

mysql if 多个_MySQL使用IF语句CONCAT多个字段

语法不正确.你想使用CASE:SET loc_name Location;SET add_street Add Street;SET add_number 10;SET x_street_1 Street 1;SET x_street_2 Street 2;SET city City;SET state State;SET country Country;SELECT Concat(loc_name, \n, CASEWHEN add_number !…

IOS+Android马甲包封装上架!

目的 我们有自己的一个主网站平台,为了推广我们的主网站平台,我们需要长期制作大量马甲app,然后引导用户到我们的主网站游戏,所以,你制作的app的功能只给审核人员看到,只是为了应付审核,app上架…

软件工程概论课后作业01

1. 网站系统开发需要掌握的技术 ①java语言 Java语言体系比较庞大,包括多个模块。从WEB项目应用角度讲有JSP,Servlet,JDBC,JavaBean(Application)四部分技术。JDBC可做三件事情:与数据库建立连接…

mysql low_case_MySQL8.0的坑之lower_case_table_names

在安装了8.0.14之后,初始化的时候在my.cnf里设置了lower_case_table_names1,安装好了之后,启动报错:2019-01-28T13:24:24.91946308:00 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.14) starting as…

php5.4 mysql connect_php5.4 Call to undefined function mysql_connect()

今天学习PHP中连接MySQL,使用mysql_connect()函数时,碰到以下错误:“Call to undefined function mysql_connect()”,PHP版本:5.4.29MySQL版本:5.5.28Apache版本:2.2.22解决方法如下&#xff1a…

Js slice()方法和splice()方法

1、slice(start,end) 从已有的数组中返回选定元素,参数start必填&#xff0c;end选填 <script>delArray();function delArray(){var workExp["早上","中午","下午","晚上"];var a workExp.slice(0,3);//早上&#xff0c;中午&am…

mysql 参数bug_MySQL 的这个 BUG,坑了多少人?

作者&#xff1a;腾讯数据库技术来源&#xff1a;cloud.tencent.com/developer/article/1367681▌问题描述近期&#xff0c;线上有个重要Mysql客户的表在从5.6升级到5.7后&#xff0c;master上插入过程中出现"Duplicate key"的错误&#xff0c;而且是在主备及RO实例上…

mongodb 2php 操作

1连接 db.getCollection(test).find({}) // 连接Mongo数据库 数据库地址:端口/账号:密码; $mongo new Mongo(mongodb://localhost:27017/admin:admin); $this->link new \MongoClient(mongodb://user:passwordhost:port/dbname); // 选择一个数据库和要操作的集(如果没有…

i9 9900k mysql_i9-9900K和9900KS有什么区别?i9-9900KS和i9-9900K区别对比评测

众所周知&#xff0c;i9-9900KF相当于i9-9900K去除核显的版本&#xff0c;其它参考保持一致&#xff0c;所以在性能上也是相同的。不过在近期&#xff0c;intel牌牙膏厂再一次发布了一款九代酷睿i9-9900KS特别版&#xff0c;从产品型号S后缀上来看&#xff0c;确实有点类似于NV…

Memory及其controller芯片整体测试方案(上篇)

如果你最近想买手机&#xff0c;没准儿你一看价格会被吓到手机什么时候偷偷涨价啦&#xff01; 其实对于手机涨价&#xff0c;手机制造商也是有苦难言&#xff0c;其中一个显著的原因是存储器芯片价格的上涨↗↗↗ >>> 存储器memory的江湖地位 存储器memory&#xff0…

MySQL水表查询系统_水费管理系统

数据库-水费管理系统根据数据库设计步骤&#xff1a;需求分析、逻辑结构设计、概念结构设计、物理结构设计、数据库实施、数据库的运行和维护等几个阶段来执行的。现在处于前期准备阶段。由于之前一直考试&#xff0c;也没有把它具体实现&#xff0c;在接下来的一段时间里会逐渐…

SVN中如何去除版本控制器

https://www.cnblogs.com/lrzr/p/6079772.html转载于:https://www.cnblogs.com/ZkbFighting/p/7886762.html

mysql编译安装后目录空_MySQL源码安装完成后修改安装路径启动问题

在Linux上源码编译安装完mysql后&#xff0c;又将安装的路径进行了修改&#xff0c;但是发现在设置后环境变量后启动报错&#xff0c;如下&#xff1a;[rootHServer_03 var]# mysqld_safe --usermysql &[1] 31248[rootHServer_03 var]# 110422 11:04:00 mysqld_safe Loggin…

mac下用xattr命令来删除文件的扩展属性

mac下发现不能用记事本打开文本文件&#xff0c;ls -la 发现格式后面有个 [plain] view plaincopy wenke-mini:changeServer wenke$ ls -la total 144 drwxr-xr-x 20 wenke staff 680 6 4 16:37 . drwxr-xr-x 22 wenke staff 748 6 3 16:54 .. -rw-r--r-- 1…

mysql 5.6 修改端口_mysql5.6.24怎么修改端口号

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html# *** DO NOT EDIT THIS FILE. Its a template which will be copied to the# *** default loca…

BootStrapJS——modal弹出框

学习参考视频https://ninghao.net/video/1615 1.对话框 - Modal 需要bootstrap的CSS文件引入&#xff0c;以及jQuery的js包 1 <!DOCTYPE html>2 <html lang"en">3 <head>4 <meta charset"UTF-8">5 <title>弹窗测试&…

mysql 自动备份删除_mysql自动备份删除5天前的备份

1、查看磁盘空间情况&#xff1a;# df -h2、创建备份目录&#xff1a;上面我们使用命令看出/home下空间比较充足&#xff0c;所以可以考虑在/home保存备份文件&#xff1b;cd /homemkdir backupcd backup3、创建备份Shell脚本:注意把以下命令中的DatabaseName换为实际的数据库名…

mysql多表查询方式_MySQL多表查询方式问题

你的 SQL 没有用到任何索引&#xff0c;对 a b 两个表都是全表扫描&#xff0c;在数据量小的时候是没有问题的&#xff0c;但是如果数据量超过 100 万&#xff0c;性能问题就会突显出来。这里不清楚你的 created_at 字段是什么类型&#xff0c;不过从你的代码 DATE_FORMAT(crea…

IpV4 TCP

&#xff49;&#xff50;&#xff56;&#xff14;头基本是&#xff12;&#xff10;个字节&#xff0c;最多&#xff16;&#xff10;个个&#xff08;&#xff29;&#xff28;&#xff2c;域限定4bit 15*460【最多&#xff11;&#xff15;个&#xff14;字节&#xff0c;即…