开发者

Jquery - Toggle & page refresh open div

开发者 https://www.devze.com 2023-01-06 11:17 出处:网络
How do you open a JQuery toggle from a url? at the moment I am using return false to prevent an href action but I would really prefer to keep the href action to refresh the page.

How do you open a JQuery toggle from a url? at the moment I am using return false to prevent an href action but I would really prefer to keep the href action to refresh the page.

here is my code

$('#adminMenu h3').click(function() {
    $(this).next('ul').slideToggle("slow");
    return false;
    });

and this is the html

<h3 title="first toggle ul"><a href="?p=first">first toggle ul</a></h3>
<ul>
    <li><a href="?inc=aa" class="pageLink" title="A page">A page</a></li>
    <li><a href="?inc=ab" class="pageLink" title="AA page">A page</a></li>      
</ul>

<h3 title="Next toggle ul"><a href="?p=next">Next toggle ul</a></h3>
    <ul>
        <li><a href="?inc=ba" class="pageLink" title="A page">A page</a></li>
        <li><a href="?inc=b" class="pageLink" title="A page">A page</a></li>
        <li><a href="?inc=c" class="pageLink" title="A pag开发者_如何学Goe">A page</a></li>
        <li><a href="?inc=d" class="pageLink" title="A page">A page</a></li>
    </ul>

As I said for numerous reasons I really want to refresh the page on click of the


The question is not clear. But if you need to REFRESH the page AFTER the slideToggle you can do:

$('#adminMenu h3').click(function() {
$(this).next('ul').slideToggle("slow",function(){window.location.reload()});
return false;
});

Don't know if this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号