Okay
  Public Ticket #2214614
Trigger dropdown menu by clicking image
Closed

Comments

  • riczito started the conversation

    Hi guys,

    Sorry to keep bothering you, but I've run into a roadblock, and I can't find a solution.

    If you go to the site I’m working on : http://www.pixelligence.com/brunoonaissi 

    you’ll see a rainbow-coloured icon in the top right corner. When you click it, currently a modal dialogue box opens. This was the client’s idea… I never liked it. I'm using a plugin to achieve this, and it isn't very satisfactory.

    Thankfully, he’s changed his mind now, and what he wants is that when you click it, a small dropdown menu opens, with three items in it. Much better. I've done a very quick mockup in Photoshop, which I attach here.

    However, I can’t seem to find a way to trigger a dropdown menu from an image. Every menu widget I’ve tried only seems to be able to trigger a dropdown from a text link. Some of them allow you to add an icon from its icon library next to the link, but you can’t choose a custom image.

    I've also tried some "popover" widgets, but I have the same issues. They can only be triggered by buttons, not custom images.

    This seems like a very simple thing to ask, but I’ve run into a wall. Do you have any ideas? I would be very grateful !

    Thanks,

    Ric


  •  675
    Neuron replied

    Hi Ric,

    Sorry for the late reply, haha, the clients can be tough sometimes, but glad that you've found a great solutionsmile.png

    I will list the steps below how you'll be able to achieve this one.

    1. Create a new menu at Appearance > Menus
    2. Tick on the screen options at top right.
    3. Enable the CSS classes. https://prnt.sc/pxezhv
    4. Add Custom Links and to the first one add the following class. https://prnt.sc/pxf0mz
    5. Go to Appearance > Customize > Additional CSS and add the following style.

    .trigger-dropdown:before {
       content: url('https://placehold.it/50x50');
       cursor: pointer;
    } .trigger-dropdown a {
        text-indent: -99999px;
        position: absolute;
    }

    https://prnt.sc/pxf2e4 -> The final result.

    Feel free to ask for anything you need.

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.