I have a wordpress web site with Twenty Eleven Child Theme. In my sidebar I've embedded a jQuery Vertical Mega Menu widget from:
http://wordpress.org/extend/plugins/jquery-vertical-mega-menu/
The menu works fine. The only problem is that when the web site loads there is a short FOUC (Flashing of unstyled content).
http://en.wikipedia.org/wiki/Flash_of_unstyled_content
I don't know how to prevent it from flashing. I read a few similar questions with solutions but I can't figure out how to apply it to my child theme.
Some say you have to add jQuery(document).ready(function() {
. But where in? I tried to add it into my child theme's functions.php:
<?php
....
.....
function id_scripts() {
jQuery(document).ready(function() { echo 'test'});
}
add_action('wp_enqueue_scripts', 'id_scripts');
>
But it gives me a parse error saying:
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /..../functions.php on line 28