• Resolved zehheal

    (@zehheal)


    Is it possible to show the search results above the search form rather than below?

    Trying to set up a responsive site where its below on PC/tablet, but above on a phone.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Yes, it is possible but you will need to make some code changes.

    Open assets/js/common.js file, find code

    resultLayout: function () {
                    var offset = self.offset();
                    var bodyOffset = $('body').offset();
                    var bodyPosition = $('body').css('position');
    
                    if ( offset && bodyOffset  ) {
    
                        var width = self.outerWidth();
                        var top = 0;
                        var left = 0;
    
                        if ( bodyPosition === 'relative' ) {
                            top = offset.top + $(self).innerHeight() - bodyOffset.top;
                            left = offset.left - bodyOffset.left;
                        } else {
                            top = offset.top + $(self).innerHeight();
                            left = offset.left;
                        }
    
                        $( d.resultBlock ).css({
                            width : width,
                            top : top,
                            left: left
                        });
    
                    }
    
                },

    and replace it with

     resultLayout: function () {
    	var offset = self.offset();
    	var bodyOffset = $('body').offset();
    	var bodyPosition = $('body').css('position');
    	var resultHeight = $( d.resultBlock).outerHeight();
    	var formHeight = $searchForm.height();
    
    	if ( offset && bodyOffset  ) {
    
    		var width = self.outerWidth();
    		var top = 0;
    		var left = 0;
    
    		if ( bodyPosition === 'relative' ) {
    			top = offset.top + $(self).innerHeight() - bodyOffset.top;
    			left = offset.left - bodyOffset.left;
    		} else {
    			top = offset.top + $(self).innerHeight();
    			left = offset.left;
    		}
    
    		$( d.resultBlock ).css({
    			width : width,
    			top : top - resultHeight - formHeight,
    			left: left
    		});
    
    	}
    
    },
    Thread Starter zehheal

    (@zehheal)

    Works like a charm, cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search results above instead of below?’ is closed to new replies.