<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">*generic. It's 4:24 AM here and I'm amazed I can still focus on my work.<div><br><div><div><div>On Mar 20, 2013, at 4:23 AM, Daniel Tara wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm sorry, I wanted to say no need to be this general :)<div><br><div><div>On Mar 20, 2013, at 4:22 AM, Daniel Tara wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><blockquote type="cite"><div>&lt;script type="text/javascript"&gt;jQuery("ul").parent("li").addClass("parent");&lt;/script&gt;</div></blockquote><div><br></div>There's no need to be this specific. WordPress adds a&nbsp;<span style="color: rgb(0, 0, 0); font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">sub-menu</span>&nbsp;class to second level menus so you can do it like this:<div><br></div><div>$('.sub-menu').parent('.menu-item').addClass('parent');</div><div><br></div><div>Daniel</div><div><br><div><div>On Mar 20, 2013, at 4:01 AM, Otto wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Tue, Mar 19, 2013 at 8:32 PM, Bryan Hadaway &lt;<a href="mailto:bhadaway@gmail.com">bhadaway@gmail.com</a>&gt; wrote:<br><blockquote type="cite">Cool, so in the future I could use this technique to get the class in there<br></blockquote><blockquote type="cite">in order to have the dropdown arrows as apposed to the jQuery trick (which<br></blockquote><blockquote type="cite">will obviously have much more load) that I'm using to get .parent? If that's<br></blockquote><blockquote type="cite">correct, I'll definitely put that on my list of improvements to be made.<br></blockquote><br>Yeah, also note that having that script in the header like that, with<br>the very wide scope of it's target, could lead to some very<br>unpredictable consequences.<br><br>&lt;script type="text/javascript"&gt;jQuery("ul").parent("li").addClass("parent");&lt;/script&gt;<br><br>This script is run at the time that it enters the DOM, which is more<br>or less immediately after parsing it. But JS typically runs in a<br>separate thread. So while you're intending it to probably only affect<br>the nav-menu at this point, it is within the realm of possibility that<br>some of the rest of the page may load before it actually runs and<br>does-its-thing. Thus, it is entirely possible for, say, the sidebar<br>widgets (if they're in a UL/LI structure, which they usually are) to<br>thus be affected by this JS code as well.<br><br>Now, I ain't a theme-reviewer, but I'd certainly fail this code under<br>any reasonable sanity standard. :) It's just too broad in scope and<br>it's relying on a side-effect of browser behavior to affect only its<br>intended targets.<br><br>-Otto<br>_______________________________________________<br>theme-reviewers mailing list<br><a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br><a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div><br></div></div></body></html>