只有slideToggle()子div的通用方法(Generic way to only slideToggle() child div)
jquery的新手。 我想做一个slideToggle手风琴折叠并扩展一个部分。
单击标题时,我想展开/折叠“#section”中的所有内容。
<h3 id="assignments">Assignments</h3> <div id="section"> Assignment Count <input type="number" name="assignment_count"> </div>
我有下面的代码。 但是我想让它变得通用,这样如果我有任何标题我点击它,它只会折叠它下面的部分而不是所有div的id为“#section”
$(document).ready(function(){ $("h3").click(function(){ $("#section").slideToggle(); }); });
New to jquery. I want to do a slideToggle to accordion collaps and expand a section.
When clicking the header, I want to expand/collapse everything in "#section".
<h3 id="assignments">Assignments</h3> <div id="section"> Assignment Count <input type="number" name="assignment_count"> </div>
I have the code that works below. But I want to make it generic so that if I have any header I click, it will only collapse the section below it and not all div's with an id of "#section"
$(document).ready(function(){ $("h3").click(function(){ $("#section").slideToggle(); }); });
原文:https://stackoverflow.com/questions/31101793
更新时间:2022-05-17 17:05
最满意答案
问题在这里:
":siid",$_POST['const_siid'], ^--- should be "=>", not ","
Problem is here:
":siid",$_POST['const_siid'], ^--- should be "=>", not ","
相关问答
更多-
问题在这里: ":siid",$_POST['const_siid'], ^--- should be "=>", not "," Problem is here: ":siid",$_POST['const_siid'], ^--- should be "=>", not ","
-
只有在实际将它们添加到查询时绑定这些变量: //Status Filter Query $sql .=' AND status = :status'; $vars = array(':status' => $status); //Type Filter Query if (!is_null($type)) { $sql .=' AND type = :type'; $vars[':type'] = $type; } // Session Filter Query if (!is_nul ...
-
在查询params变量中,您忘记在更新查询中添加:sessionidstudent ,添加它并且错误将消失 In the query params variable you forgot to add the :sessionidstudent in the update query, add that and the error will be gone
-
你没有绑定postID 。 它位于WHERE子句中,并且参数中缺少它。 You haven't bound postID. It's in your WHERE clause and it's missing from the parameters.
-
$i = 0 和 警告:PDOStatement :: bindValue():SQLSTATE [HY093]:无效的参数编号:列/参数是基于1的 比较这两件事,你会发现你的$i必须从1开始,而不是0。 这也可以从PHP手册中确认 参数 参数标识符。 对于使用命名占位符的预准备语句,这将是以下形式的参数名称:name。 对于使用问号占位符的准备好的语句,这将是参数的1索引位置。 $i = 0 And Warning: PDOStatement::bindValue(): SQLSTATE[HY093 ...
-
你正在构建param_new错误,这是为什么 $_POST['post_name'] = 'someName'; $param_new = "':code' =>124,':name' =>".$_POST['post_name'].""; print_r(array($param_new)); /*output Array ( [0] => ':code' =>124,':name' =>someName ) */ 这是你最终传递给execute()一个array ,它包含一个包含逗号分隔 ...
-
SQLSTATE [HY093]:参数号无效:没有参数被绑定(SQLSTATE[HY093]: Invalid parameter number: no parameters were bound)[2023-02-19]
你混淆了刷新你的实体管理器和添加一个flash消息。 代替: $em->flush('success', 'Komentarz został pomyślnie dodany'); $this->addFlash(); 你要: $em->flush(); $this->addFlash('success'); $this->addFlash('Komentarz został pomyślnie dodany'); You have mixed up flushing your entity-manag ... -
请尝试仅使用一个%,因为:%是零个或多个字符的替代。 你不需要2个。 LOWER函数将一个字符串作为参数,'%:last_string%'作为字符串而不是作为对数组的绑定(':last_string'=> $ last_string),这就是删除绑定时它的工作原理。 所以尽量不要将:last_string放在LOWER函数中,因为它不会将它识别为绑定。 Try using only one % because: % is a substitute for zero or more characters. Y ...
-
警告:PDOStatement :: execute():SQLSTATE [HY093](Warning: PDOStatement::execute(): SQLSTATE[HY093])[2024-01-21]
Execute可以接受一组参数,而不是单独绑定它们。 所以,首先,删除这个: if(count($params)) { foreach($params as $param) { $x = 1; $this->_query->bindParam($x, $param); $x++; } } 你可能 ... -
好吧,这对于评论来说太长了(没有双关语意图在那个“长”顺便说一句)。 看到如果那些不是拼写错误(我希望它们不是),你有很多结合后有空格的绑定。 您需要为它们删除空格,并将标记为LONG的MySQL保留字包裹起来,或者将其重命名为保留字以外的其他内容。 即 SET `long`=:long, ... 参考: https://dev.mysql.com/doc/refman/5.5/en/keywords.html 脚注: TBH:我没有计算你所有的约束力,所以如果我错过了一些东西,你需要仔细检查它们并确保它 ...