anchors break interior page

  • kjamson
    Inactive member
  • Topic Author
  • Member
  • Member
More
12 years 7 months ago #18246 by kjamson
Hi,

I found out that if I use anchors in the article, it causes the menu on the top to break. Is there any way to fix it? Thanks.

noble.kjamson.com/index.php/faq

Please Log in to join the conversation.

More
12 years 7 months ago #18291 by ivan.milic
What do you mean by anchor , anchor in joomla/php/css world refers to this:

www.w3schools.com/css/css_pseudo_classes.asp

but I dough you meant that or I don't understand you. If you think on anchor like in some Microsoft product (like Visual Studio Forms designer) that does not exist here.

Please Log in to join the conversation.

  • kjamson
    Inactive member
  • Topic Author
  • Member
  • Member
More
12 years 7 months ago #18292 by kjamson
Hi Ivan,

That's exactly what I meant. The anchor links on the page. Basically, the link I posted is displaying an article. It contains a list of questions as the top portion of the article, and the bottom portion is the answers. Each question contains a link to the anchor of the corresponding answers. If you click on one of the links, it brings you to the answer, but if you scroll up afterwards, you will see the top navigation menu is gone.

Thanks.

Please Log in to join the conversation.

More
12 years 7 months ago #18308 by ivan.milic
add this in index.php of template just before </head>

<script type="text/javascript">
jQuery(document).ready(function(){ if(window.location.href.indexOf('#')) jQuery('.interior_page').css('top','-30px');});
</script>

Please Log in to join the conversation.

  • kjamson
    Inactive member
  • Topic Author
  • Member
  • Member
More
12 years 6 months ago #19186 by kjamson
Hi Ivan,

I tried your solution. It works, but it only works if the user refresh the page because the script is in the header. If the user just click on the link and not refresh the page, which is the common browsing habit, the issue still remains. Is there a way to fix it without having the user to refresh the page?

Thanks.

Please Log in to join the conversation.

More
12 years 6 months ago #19220 by ivan.milic
try this:

<script type="text/javascript">
jQuery(document).ready(function(){ if(window.location.href.indexOf('#')) jQuery('.interior_page').css('top','-30px');
jQuery('.interior_page').delay(1000).css('top','-30px');
});
</script>

Please Log in to join the conversation.

Time to create page: 0.086 seconds
Powered by Kunena Forum