Jquery ui Accordion - 如何在右侧添加图标?
将 jquery ui 图标之一添加到手风琴小部件标题右侧的 css/added html 是什么?
例如,如果我有 html:
<!-- Accordion -->
<div id="accordion">
<div>
<h3><a href="#"><span class="title">Content</span><span class="ui-icon ui-icon-newwin"></span></a></h3>
<div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
</div>
<div>
<h3><a href="#">Second</a></h3>
<div>Phasellus mattis tincidunt nibh.</div>
</div>
<div>
<h3><a href="#">Third</a></h3>
<div>Nam dui erat, auctor a, dignissim quis.</div>
</div>
</div>
我可以添加 css 以使 jquery ui 图标出现在右侧吗?
whats the css/added html to add one of the jquery ui icons to the right side of the accordation widget's headers?
for example, if i have the html:
<!-- Accordion -->
<div id="accordion">
<div>
<h3><a href="#"><span class="title">Content</span><span class="ui-icon ui-icon-newwin"></span></a></h3>
<div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
</div>
<div>
<h3><a href="#">Second</a></h3>
<div>Phasellus mattis tincidunt nibh.</div>
</div>
<div>
<h3><a href="#">Third</a></h3>
<div>Nam dui erat, auctor a, dignissim quis.</div>
</div>
</div>
can i add css to make the jquery ui icon appear on the right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我想我已经弄清楚了。通过添加这个CSS,它似乎工作正常。
如果发现任何问题,请告诉我。
I think i've figured this out. By adding this css it seems to work fine.
Let me know if any issues are found with this.
这个怎么样? (请务必更改“redmond”主题以适合您的主题)
How about this? (be sure to change "redmond" theme to fit your theme)
这有效:
正如本文前面提到的,将绝对定位设置为“right: x;”没有完成这项工作(莫名其妙地)。所以我只是给了它一个非常大的“左”值。感觉有点老套,但就这样吧。
This works:
As mentioned earlier in this post, setting the absolute positioning to 'right: x;' doesn't do the job (inexplicably). So I just gave it a very large 'left' value. Feels a wee bit hacky but so be it.
ui-icon
的float:right
应该可以解决问题。最后,将float:left
添加到span.title
以避免任何 IE 问题。float:right
forui-icon
should do the trick. Eventually, addfloat:left
tospan.title
to avoid any IE issues.试试这个:
try this:
谢谢Sevmusic。这是您的帖子的后续内容,适合那些想要嵌套手风琴并在每个手风琴上方仍然有一个图标组的人。
希望这会节省一些人的时间来让它工作!
干杯。
Thanks Sevmusic. This is a follow-up on your post for those who want to have nested accordions and still have an icon-group above each one of them.
Hopefully, this would save someone a bit of time getting this to work!
Cheers.
为什么你解决得太难了。简单的图标解决方案并关闭 H3 标签中标题的填充。将其设置为在 jquery 样式之后加载的 css。
Why you solve too hard. Easy solution for icons and switch off padding of title in H3 tag. Set this to your css loaded after jquery styles.