选项卡的标题显示在垂直折叠的右侧

编程入门 行业动态 更新时间:2024-10-27 18:34:19
本文介绍了选项卡的标题显示在垂直折叠的右侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

发生了什么?:手风琴工作正常,但手风琴右侧显示标签。

jQuery

$(document).ready(function(){ $ accordion .title)。click(function(){ $(this).next(。accordion .details)。slideToggle(500)})next()。 });

CSS :

编辑:

使用hoverbox功能更新的代码: http ://jsfiddle/GRATx/1/

What's going on?: The accordion is working properly, but the tabs show up on the right side of the accordion.

jQuery

$(document).ready(function(){ $(".accordion .title").click(function(){ $(this).next(".accordion .details").slideToggle(500) }).next().hide(); });

CSS: Hoverbox

.hoverbox { cursor: default; list-style: none; } .hoverbox a { padding-top: 5px; cursor: default; text-decoration: none; color: black; } .hoverbox a .preview { display: none; } .hoverbox a:hover .preview { display: block; position: absolute; top: -33px; left: -45px; z-index: 1; } .hoverbox img { vertical-align: top; height: 125px; } .hoverbox li { display: inline; float: left; margin: 3px; padding: 5px; position: relative; text-align: right; text-decoration: none; } .hoverbox .preview { border-color: #000; height: 300px; } .gallery { width: 100%; }

HTML: A sample for one image.

<div class="accordion"> <div class="title"><h2></h2></div> <ul class="details"> <div class="gallery"> <ul class="hoverbox"> <li> <a href="#"> <img src="pictures/1.jpg" class="thumbnail"/> <img src="pictures/1.jpg" class="preview"/></br> Compass </a> </li> </ul> </div> </ul> </div>

First, let's start off with a just loaded accordion.

After I click "Glass Windows", this is what happens.

What I have done: For the past four or five days I have been spending many hours relocating <div> tags, making sure my code is correct and dabbling with the CSS (specifically making sure the text wasn't aligned oddly or there was something goofy about how the images were displayed). Not very specific, I know. I apologize for the not so short and concise question.

Update

I attempted to use Dexter's suggestion, but I still keep having issues with the text alignment.

After clicking on Section 1...

And Section 2...

As stated before, each section should be underneath one another. The Videos section is separate from the accordion and Home is a part of the navigation list at the bottom of the page (serves as the footer).

I've come to understand that this may be an issue with my CSS for everything else not accordion related. Since I have no idea what's the problem, I will just upload the entire CSS (which is about the same length as the accordion CSS)... if of course, that is 'okay'.

解决方案

So, is this what you're trying to achieve?

See fiddle here: jsfiddle/GRATx/

EDIT:

Code in fiddle [updated with hoverbox functionality]: jsfiddle/GRATx/1/

更多推荐

选项卡的标题显示在垂直折叠的右侧

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

发布评论

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

>www.elefans.com

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