You'll need to use PHP to hide those elements when they are created in
the HTML output.  The simplest (but ugliest) way to do this would be
to add a style="display: none;" to each of the elements (or parent
elements) that you want hidden.  This should work assuming you're
using one of jQuery's native show()/hide() (or something similar)
commands that change this display attribute.

On Dec 6, 6:05 am, bytte <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I use php to fetch a menu out of a mysql database. Basically the menu
> is made up of a lot of nested unordered lists (<ul>). I'm using jQuery
> to hide any submenu. This means that when a user visits the webpage he
> only sees the first <ul>. When he clicks a <li>, the submenu (again an
> <ul>) is shown.
>
> This works great on my localhost. However, when I publish online I
> experience a problem: on page load the whole <ul> is shown for a
> second, including all nested <ul> submenu's, before it is hidden by
> jQuery. I guess this is because all <ul> elements need to be loaded
> into the DOM before the jQuery code is started?
>
> Is there anything I can do to solve this problem?
>
> Thanks for any advice!

Reply via email to