Remove pop up search Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Remove pop up search

    EnigmaSpirit
    EnigmaSpirit
    New Member


    Posts : 6
    Reputation : 2
    Language : English

    Solved Remove pop up search

    Post by EnigmaSpirit January 23rd 2021, 5:46 pm

    Good Morning,

    I am trying to remove the pop up search from my forum and instead have the navigation bar just link to the search page. The code has the onclick property to fire the search box, I can't find a way to remove this as it's not accessible in the templates.

    Here's a screenshot of why I want to remove it, it falls behind the #wrap in my code.

    Remove pop up search Screen10

    My forum link is pogoraids.forumotion.com, accessible at pogoraiders.com.. Forum version is ModernBB

    Edit: the code that shows in dev console is

    Code:
    <a class="mainmenu" href="/search" onclick="showhide(document.getElementById('search_menu')); return false;" target="_blank">Search</a>

    So i tried to override using

    Code:
    const a = document.querySelector('.mainmenu');
    a.onclick = null;
    a.removeAttribute('target');

    However this does nothing.


    Last edited by EnigmaSpirit on January 23rd 2021, 9:15 pm; edited 1 time in total
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3239
    Reputation : 250
    Language : English, Italian, French
    Location : Italy

    Solved Re: Remove pop up search

    Post by Niko January 23rd 2021, 8:19 pm

    Dear @EnigmaSpirit,

    have you tried with this?
    Code:
    $(function() {
        const a = document.querySelector('.mainmenu');
        a.onclick = null;
        a.removeAttribute('target');
    });

    Let me know :rose:
    EnigmaSpirit
    EnigmaSpirit
    New Member


    Posts : 6
    Reputation : 2
    Language : English

    Solved Re: Remove pop up search

    Post by EnigmaSpirit January 23rd 2021, 9:04 pm

    Niko wrote:Dear @EnigmaSpirit,

    have you tried with this?
    Code:
    $(function() {
        const a = document.querySelector('.mainmenu');
        a.onclick = null;
        a.removeAttribute('target');
    });

    Let me know :rose:

    This does not work.
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3239
    Reputation : 250
    Language : English, Italian, French
    Location : Italy

    Solved Re: Remove pop up search

    Post by Niko January 23rd 2021, 9:09 pm

    @EnigmaSpirit try this one then Hello

    Code:
    $(function() {
    $('.mainmenu[href="/search"]').attr('onclick',null);
    });

    skouliki and SarkZKalie like this post

    EnigmaSpirit
    EnigmaSpirit
    New Member


    Posts : 6
    Reputation : 2
    Language : English

    Solved Re: Remove pop up search

    Post by EnigmaSpirit January 23rd 2021, 9:14 pm

    Niko wrote:@EnigmaSpirit try this one then Hello

    Code:
    $(function() {
    $('.mainmenu[href="/search"]').attr('onclick',null);
    });

    You are amazing, thank you!

    Niko likes this post

    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15328
    Reputation : 1705
    Language : English,Greek
    Location : Greece

    Solved Re: Remove pop up search

    Post by skouliki January 23rd 2021, 10:38 pm

    Problem solved & topic archived.
    Please read our forum rules: ESF General Rules