通过找到的手风琴激活手风琴

编程入门 行业动态 更新时间:2024-10-15 18:26:48
本文介绍了通过找到的手风琴激活手风琴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在 jquery ui文档中,有按索引激活手风琴的方法. br> 但是我想从找到手风琴"中激活. 在下面的代码或任何其他解决方案中,必须用 ??? 替换什么

In jquery ui doc , there is method by index to activate accordion. However I want to activate from "accordion found". What must be replaced by ??? in code below, or any other solution

var accordion = $('.ui-accordion') accordion.each(function () { var hashHref = $.param.fragment(); //hashHref is the anchor href of relevant accordion $(this).find("a[href='#" + hashHref + "']").???; });

谢谢

推荐答案

在此答案,可以解决这种情况:

with the help of this answer, this solves the case:

accordion.each(function () { var hashHref = $.param.fragment(); var findElement = $(this).find("a[href='#" + hashHref + "']"); if (findElement.length) { var ndx = $(findElement).parent().index() * 0.5; $(this).accordion("activate", ndx); } });

更多推荐

通过找到的手风琴激活手风琴

本文发布于:2023-11-25 00:47:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627626.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:手风琴

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!