- Posts: 25
- Thank you received: 0
anchors break interior page
-
kjamson
Inactive member - Topic Author
- Member
Less
More
12 years 7 months ago #18246
by kjamson
anchors break interior page was created 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
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.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
12 years 7 months ago #18291
by ivan.milic
Replied by ivan.milic on topic Re: anchors break interior page
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.
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
Less
More
- Posts: 25
- Thank you received: 0
12 years 7 months ago #18292
by kjamson
Replied by kjamson on topic Re: anchors break interior page
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.
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.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
12 years 7 months ago #18308
by ivan.milic
Replied by ivan.milic on topic Re: anchors break interior page
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>
<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
Less
More
- Posts: 25
- Thank you received: 0
12 years 6 months ago #19186
by kjamson
Replied by kjamson on topic Re: anchors break interior page
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.
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.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
12 years 6 months ago #19220
by ivan.milic
Replied by ivan.milic on topic Re: anchors break interior page
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>
<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