• I’m experimenting with a mouseenter/mouseleave HTML5 animation I’ve designed with CreateJS. It works in all the popular browsers including IE9 so I’m assuming it’s safe to use. What I’d like to do is set the canvas that holds the animation as a background for the parent li elements of wp_nav_menu.

    Say I have a canvas with an id of #canvas, and I were to assign a menu_id of #nav to WordPress’s new wp_nav_menu function:

    wp_nav_menu( array( 'menu_id' => 'nav',
                        'theme_location' => 'primary' ) );

    How should I go about referencing #nav li with jQuery as to append #canvas to it as the li’s background image? Any WordPress gurus willing to give this a shot? To the best of my knowledge, you can’t reference a canvas as a CSS background of an li element, so I’m guessing I’ll have to give it an absolute position and send it to the back with a z-index. Any suggestions?

  • The topic ‘Using canvas element as background for wp_nav_menu li elements’ is closed to new replies.