Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • rkdesign11 Friend
    #1046082

    Hi, I’d like to change the fancy search feature in the ‘head search’ to a normal search box and button, so the menu doesn’t disappear etc, how can I do that?

    Pankaj Sharma Moderator
    #1046171

    Hi
    Open template folder /js/script.js file
    find and remove

    
    // Head Search
    // --------------
    (function($){
      $(document).ready(function(){
        if($('.logo').outerWidth() < $('#t3-header .container').outerWidth()) {
          var searchWidth = $('#t3-header .container').outerWidth() - $('.head-right').outerWidth() - $('.logo').outerWidth();
          $('.head-search-wrap').css('width',searchWidth);
        } else {
          var searchWidth = $('#t3-header .container').outerWidth() - $('.head-right').outerWidth();
          $('.head-search-wrap').css('width',searchWidth);
        }
    
        $(window).resize(function(){
          if($('.logo').outerWidth() < $('#t3-header .container').outerWidth()) {
            var searchWidth = $('#t3-header .container').outerWidth() - $('.head-right').outerWidth() - $('.logo').outerWidth();
            $('.head-search-wrap').css('width',searchWidth);
          } else {
            var searchWidth = $('#t3-header .container').outerWidth() - $('.head-right').outerWidth();
            $('.head-search-wrap').css('width',searchWidth);
          }
        });
    
        $('.btn-search').click(function() {
            $('.head-search').toggleClass('btn-open');
            $('.head-search-wrap').toggleClass('btn-open');
            $('.head-right').toggleClass('btn-open');
    
            if ($('.head-search-wrap').hasClass('btn-open')) {
              $('#mod-search-searchword').focus();
            }
        });
    
        $('.t3-navbar .t3-megamenu ul li>a').click(function(e){
            if ($(this).hasClass('dropdown-toggle')) {
                window.location.href = $(this).attr('href');
            }
        });
      });
    })(jQuery);

    now open header.php
    find

        <!-- HEAD SEARCH -->
                        <div class="head-search <?php $this->_c('head-search') ?>">
                            <button type="button" class="btn btn-search">
                              <i class="fa fa-search"></i>
                              <i class="fa fa-close"></i>
                            </button>
                        </div>
                        <!-- //HEAD SEARCH -->

    replace it with

    <!-- HEAD SEARCH -->
                        <div class="head-search <?php $this->_c('head-search') ?>">
                            <jdoc:include type="modules" name="<?php $this->_p('head-search') ?>" style="raw" />
                        </div>
                        <!-- //HEAD SEARCH -->

    save and check, you will get the default search module.

    Regards

    rkdesign11 Friend
    #1046346

    That’s great – thank you. One further question, is it possible to move the last 2 menu items ‘Søg’ and ‘Forhandler’ to the right side of the naviagtion bar, so they appear to be separated from the other menu items?

    Regards
    Rob

    Pankaj Sharma Moderator
    #1046393

    Hi
    Please open a new thread for different topic questions. It also helps our community.

    Regards

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 3 replies, has 2 voices, and was last updated by  Pankaj Sharma 6 years, 10 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum