Перейти к содержимому


Фотография
- - - - -

Autocomplete


Лучший Ответ Kess , 02 October 2013 - 05:57

Try to change your CSS modifications to this

.tm-noblog #ui-id-1.ui-autocomplete {
    top: 78px !important;
}

.tm-noblog #ui-id-1.ui-autocomplete.fx {
    position: fixed;
    top: 49px !important;
}

Also I removed frontpage support because we'll hopefully remove sticky from there.

 

I've noticed that the <body> has .tm-noblog class on all pages except frontpage. Let's use it to disable sticky header there:

if (_rys(this).scrollTop() > 120) {  
    _rys('.tm-noblog #fixedheader').addClass("headerbar");
    _rys('.tm-noblog #ui-id-1').addClass("fx");
} else {  
    _rys('.tm-noblog #fixedheader').removeClass("headerbar");
    _rys('.tm-noblog #ui-id-1').removeClass("fx");
}
Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 13

#1 P.K

P.K

Отправлено 29 September 2013 - 12:26

Hi

I am facing problems with auto complete list when i scroll the page. The autocomplete suggestions stay where they were and doesnt scroll with the page

 

44mz.jpg

 

Please have a look. I can message you website login details

 

thanks


  • 0

#2 Kess

Kess

Отправлено 29 September 2013 - 12:53

Hello,

 

Yes, give us a link to the page with a problem, please.


  • 0

#3 Kess

Kess

Отправлено 29 September 2013 - 16:41

While it has nothing to do with JBZoo, the problem is because of your changes to theme.css.

.autofix {
    position: fixed;
    z-index: 40;
    }
.autorel {
    position: fixed;
    z-index: 40;
    }

Fixed position is related to the screen, so it scrolls with it. Try to remove some of your changes and see how it works.


  • 0

#4 P.K

P.K

Отправлено 01 October 2013 - 15:25

Hi

I have removed autofix and autorel. The problem now remains is that when i am at the bottom of the page and use auto complete and scroll it upwards it doesnt work properly. 

I need to use the fixed to keep the header stuck to the top. Is there some way out to solve this problem?

 

thanks in advance


  • 0

#5 Kess

Kess

Отправлено 02 October 2013 - 04:02

As I see it now, it's ok when we scroll from the top to the bottom until the header becomes sticky. So no need to change anything here. We only need to make it fixed at the same time as a header. Now I realized that you already tried something like this but didn't achieve what you want. I believe we'll do something similar now. So, in your sticky header script, we should also add a class to the search ul, so just add two lines so that part will look like this:

if (_rys(this).scrollTop() > 120) {  
    _rys('#fixedheader').addClass("headerbar");
    _rys('#ui-id-1').addClass("fx");
} else {  
    _rys('#fixedheader').removeClass("headerbar");
    _rys('#ui-id-1').removeClass("fx");
}

And in CSS:

.ui-autocomplete.fx {
    position: fixed;
    top: 49px !important;
}

.tm-isblog .ui-autocomplete.fx {
    position: fixed;
    top: 35px !important;
}

Second rule is for your frontpage only, because it's better if it will use a different height there. By the way, I think that it makes no sense to make a sticky header there. It adds no convenience for users - there is only your logo in the header bar.

 

 

Please, try this and we'll see how it works.


  • 0

#6 P.K

P.K

Отправлено 02 October 2013 - 05:38

Hi

I tried this earlier also. i have put the code. The problem is that when .fx is added the autocomplete remains with thee search bar but when i scroll it to the top and fx is removed the autocomplete remains in abnormal way i.e. misaligned. 

I also tried to make it fix in the header bar by adding additional class to keep it fixed in the headerbar and remove that class when i scroll. but that also dint help.

Yes i understand that it is useless on frontpage and i was myself searching the ways to remove it there but was unable to find the way out. Please suggest

 

thanks


  • 0

#7 Kess

Kess

Отправлено 02 October 2013 - 05:57   Лучший Ответ

Try to change your CSS modifications to this

.tm-noblog #ui-id-1.ui-autocomplete {
    top: 78px !important;
}

.tm-noblog #ui-id-1.ui-autocomplete.fx {
    position: fixed;
    top: 49px !important;
}

Also I removed frontpage support because we'll hopefully remove sticky from there.

 

I've noticed that the <body> has .tm-noblog class on all pages except frontpage. Let's use it to disable sticky header there:

if (_rys(this).scrollTop() > 120) {  
    _rys('.tm-noblog #fixedheader').addClass("headerbar");
    _rys('.tm-noblog #ui-id-1').addClass("fx");
} else {  
    _rys('.tm-noblog #fixedheader').removeClass("headerbar");
    _rys('.tm-noblog #ui-id-1').removeClass("fx");
}

Сообщение отредактировал Kess: 02 October 2013 - 05:58

  • 1

#8 P.K

P.K

Отправлено 02 October 2013 - 11:00

Hi

Perfect solution. Thanks. I tried a lot to fix it but some or another problem always remained. Voted up

 

One more thing i would like to ask here is

I was going through this http://designshack.n...h-html5-jquery/

And found one very interesting feature that as you click the autocomplete result there is no need to press search button and is implemented by i guess-

onSelect: function (suggestion) {
  // some function here
  }
 
If this feature could be implemented on jbzoo filter autocomplete it will make it really nice. Is something of this sort possible
 
thanks


#9 Kess

Kess

Отправлено 02 October 2013 - 12:39

Try this script, please:

<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery('#ui-id-1 li').live("click", function() {
        jQuery('#jbzoo-filter-search1-99').submit();
    });
});
</script>

It is a completely different solution but might work for you.


  • 0

#10 P.K

P.K

Отправлено 02 October 2013 - 14:19

Hi

It worked perfectly but two slight issues-

If i want that for multiple search bars do i need to write the code twice or is there some alternative?

 

other is when i click the autocomplete result it directly opens the product page instead of search page. Can that also be possible?

 

thanks


  • 0


Обратно в General questions


Click to return to top of page in style!