emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] collapsing some headings on html export?


From: Matt Price
Subject: Re: [O] collapsing some headings on html export?
Date: Fri, 26 Aug 2011 12:08:22 -0400



On Fri, Aug 26, 2011 at 12:04 PM, Daniel Clemente <address@hidden> wrote:
El Fri, 26 Aug 2011 09:41:38 -0400 Matt Price va escriure:
>
> On Fri, Aug 26, 2011 at 4:58 AM, Daniel Clemente <address@hidden> wrote:
> ah, that's pretty cool,daniel.  any suggestions for how I might
> implement this selectively, only for certain headings or heading
> levels?  My _javascript_ is I think even worse than my elisp...

You should start by adding jQuery to your page. Then take this code fragment:

               // handle the click event for each header
               for(var i=2;i<=7;++i) {
                       $("h"+i).each(
                               function(){
                                       $(this).css({cursor: "pointer"});
                                       $(this).bind('click', function(){ toggleForOrg_whenclicked( $(this).parent().children("div").eq(0) ); });
                               });
               }

It searches all h2, h3, h4, h5, h6, h7 elements. You can remove the loop and use another jQuery selector which finds the headers you want. They are like CSS selectors. For instance this should work: $("h2.myclass") or $("h2, h4")

For that code to work, you should copy at least these functions from esquemadorg.js: toggleForOrg_whenclicked, hideForOrg_whenclicked, showForOrg_whenclicked. Then add some CSS and custom behaviours.


fantastic, daniel.  thanks so much for this.
matt


reply via email to

[Prev in Thread] Current Thread [Next in Thread]