Forums

Modal Menu Items (3 posts)

  1. Chaotik804
    Member
    Posted 10 months ago #

    Is there anyway to edit the code or a possible plugin to make menu items call to open a modal box instead of pointing to a page or external link? I was wondering because I do not see much need to have a separate page for contacting me but I also do not have the room to place it within my widgets.

  2. simplistik
    Member
    Posted 10 months ago #

    Yea, if you're using wp_nav_menu() you should be able to control the nav output by going to Appearance > Menus in the admin. When you get to the Menus page in the upper right corner click "Screen Options" then check the "CSS Classes" checkbox, which will allow you to assign classes to your menu items. Do something like give all the ones you want to pop up in a modal a similar class, e.g. modal.

    Get your favorite javascript library, I prefer jQuery and then snag some simple lightbox/modal plugin, Colorbox is a super solid one, then target the modal objects with your JS, sorta like this:

    $(".modal a").colorbox({iframe:true, innerWidth:425, innerHeight:344});
  3. Chaotik804
    Member
    Posted 10 months ago #

    Thanks for the reply, I will see what I can do, CSS scares me, lol

Reply

You must log in to post.

About this Topic