I am creating code using Jquery that will take the text from a header
tag in my content and populate a listitem box in the sidebar pane.
Also, when clicking on the list item, it will unhide the content in
the content pane and display it to the user.  My issue right now is
that I am not able to unhide the text upon clicking the listitem.  Can
anyone please help?

Here is my Jquery code,

// I hide all the content in the content pane
$(".entry").hide();

// I populate the list items into the side pane named by the entry's
header
    $("#entries").append("<li>" + $(".entry h2").text() + "</li>");

// If I click on the list Item, I want the corresponding content with
the list items name matching the content's header to show

    $("#entries li").click(
        function(){
            var link = $(this).text();

            $(".entry h2").filter(
                function(){
                    $(this).text() == link;
                })
                .toggle();

        }
    )



my html code

 <div id='left_sidebar'>
    <div id='entries'>
    <h2 style="text-align:left">Entries</h2>

    </div>
    </div>
    <div id='content'>
    <div id='content_wrapper'>
    <div class="entry">
    <h2 id="1">April 6, 2009</h2>
    <img src="surfin.jpg" style="width:50%" alt='' />
    <p>
text text text
    </p>
    </div>
    </div>
    </div>

Reply via email to