WebSite X5Help Center

 
Michel M.
Michel M.
User

Center sections on screen after a click on an anchor  pt

Автор: Michel M.
Просмотрено 1336, Подписчики 1, Размещенный 0  

Hi,

I have a top menu on my page with full height rows enabled.

Links of that menu are using anchors to scroll to each page section, but unfortunatly sections are not always vertically centered on screen.

So, how can I get a similar result as if I did a click on little lateral sections dots?

Thank you very much.

Размещено
8 Ответы - 3 Полезно - 1 Корректно
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Лучший пользователь месяца ESЛучший пользователь месяца PT

(It > Pt) ... para que eu entenda, você deve postar seu exemplo online com as características que você disse ...
... talvez você possa usar algum código EXTRA ...

ciao

.

Читать больше
Размещено От  ‪ KolAsim ‪ ‪
Michel M.
Michel M.
User
Автор

Hi KolAsim,


You can see by yourself what i'm talking about here (even if the site is not finished):

ez-team.com/v5/caracteristicas.html

The only extra code that I have is a simple: onload='location.href="#Controlo"' on the BODY, but even if I delete it scroll behavior remains the same.

Thank you for your help.

PS: Do not worry, you answer in english. That way maybe other users can benefit from a possible solution. ;-)

Читать больше
Размещено От Michel M.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Лучший пользователь месяца ESЛучший пользователь месяца PT
Michel M.
... ... ...  PS: Do not worry, you answer in english. That way maybe other users can benefit from a possible solution. ;-)

(It > Pt) ... pra mim é igual, eu só uso o Google Translate ...
............................
... as âncoras não podem funcionar bem, porque a página contém efeitos de posicionamento atrasados ​​e, portanto, não sendo capaz de calcular a coordenada absoluta ...
... eventualmente você pode simular no jQuery o clique nos pontos relativos ...
... por exemplo, para o terceiro (3) botão, tente esta string:
#" onclick="$( '#imPageRowBullets div:nth-child(3)' ).click()
... como expliquei a você no outro tópico ...
... se funcionar para você, então você usará as outras referências (1,2,3,4,5,6,7, etc ...)...

.

ciao

.

Читать больше
Размещено От  ‪ KolAsim ‪ ‪
Michel M.
Michel M.
User
Автор

You're my savior !!!

Thank you very much KolAsim. Your code works perfectly.

Maybe that option can be added to the LINK tab, where you define a link to a page or an anchor on that same page. just saying... ;-)

Читать больше
Размещено От Michel M.
Michel M.
Michel M.
User
Автор

Yes, my ideia is to add a new field like this:

https://prnt.sc/10necnl

I don't want to bother you, but how can I go directly to the first page section when page load?

On BODY if I add this:

onload='location.href="#\" onclick=\"$( \'#imPageRowBullets div:nth-child(1)\' ).click()"'

It will obviously not work. So I need to replace the onclick by what?

Thank you.


Читать больше
Размещено От Michel M.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Лучший пользователь месяца ESЛучший пользователь месяца PT

... atrasado por três (3) segundos, (3000)m ...
.... Especialista | Código personalizado da opção 4:
onload="setTimeout(function(){$( '#imPageRowBullets div:nth-child(1)' ).click()}, 3000);"

... ou ... Especialista | Código personalizado da opção 3:
<script> $(document) .ready (function () {
setTimeout (function () {$('#imPageRowBullets div: nth-child (1)') .click ()}, 3000);
}); </script>

.

ciao

.

Читать больше
Размещено От  ‪ KolAsim ‪ ‪
Michel M.
Michel M.
User
Автор

It works perfectly.

Thank you very much, once again!

Читать больше
Размещено От Michel M.