简体   繁体   English

我希望我的div中具有动画切换高度的链接是可点击的

[英]I want links inside my div with animated toggle height to be clickable

I have a div that, when clicked, increases in height, and vice versa. 我有一个div,当单击该div时,它会增加高度,反之亦然。 Inside the div is an RSS feed catcher. div内是RSS feed捕获器。 The problem is that when the Div is expanded, and the links on the RSS feeds are clicked, the Div simply collapses rather than following the link. 问题在于,当Div展开并且单击RSS feed上的链接时,Div只会折叠而不是跟随该链接。

Here is the code: 这是代码:

$(document).ready(function(){
$("#divright").toggle(function(){
$("#divright").animate({
height:640,
borderBottomWidth: "0px"},500);
},function(){
$("#divright").animate({
height:45,
borderBottomWidth: "1px"},500);    
});
});

and the link (graphic design news bit) 和链接(图形设计新闻位)

http://flatpack.site90.com/About%20Flatpack.html http://flatpack.site90.com/About%20Flatpack.html

How can i sort it so that I can click the links on the RSS feeds, but also retain the ability to collapse the panel somehow. 我如何对其进行排序,以便可以单击RSS feed上的链接,还可以保留以某种方式折叠面板的功能。

Thanks :) 谢谢 :)

If you can, break out your toggler from the expanding area. 如果可以,请从扩展区域中断开切换器。 I would do it like this 我会这样

<div class="wrapper">
    <h2 class="toggler">Toggler</h2>
    <ul>
        <li>News</li>
    </ul>
</div>​


$(".wrapper h2.toggler").click(function(){
    var $ul = $(this).next();
    $ul.toggle("slide");
});​

http://jsfiddle.net/wz2Gt/15/ http://jsfiddle.net/wz2Gt/15/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM