I have a problem that drives me crazy. I am a relative Javascript newbie, so please be kind :).
I have some existing code for the left navigation menu that uses the Treeview plugin for jQuery ( http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ ). To quickly explain this when there are more positions in a position, a small div with an image (usually an arrow) will be added below it, and this small div can be clicked to expand the positions under it.
That is all very well, however I now want to ignore the small div and allow the user to click anywhere in the position to expand the elements below it.
Menu code snippet:
<div class="page-body-left" id="leftmenu">
<ul>
<li class="expandable" style="background-color: red;"><a class="createlink" href="link1">link1</a>
<ul style="display: none;">
<li><a class="createlink" href="link1a">link1a</a></li>
<li class="last"><a class="createlink" href="link1b">link1b</a></li>
</ul>
</li>
, , document.ready:
jQuery("#leftmenu ul > li.expandable").click(function () {
alert("Clicked!");
jQuery(this).children("ul").slideToggle("fast");
});
Firefox. IE6 IE7 , . , , (, , , ).
, , :
- ul div, , .
- "jQuery ('# leftmenu ul > li.expandable'). css ('background-color', 'red'); .
- , , , Treeview.
- div.
- , ? Treeview ? , ? , Firefox, IE!
,
jenny