Guten Tag,
ich möchte gerne einen TopLink einfügen, aber es klappt nicht so richtig.
Daher die Frage, habe ich alles richtig gemacht?
Neues Modul erstellt: Navigation Top Link
HTML-Code:
<div class="ce_toplink block">
<a href="{{env::request}}#top">nach oben</a>
</div>
Im Seitenlayout eingebunden
jQuery aktiviert
Javascriptcode im Seitenlayout eingebunden
Code:
<script>
$(document).ready(function() {
$('div.ce_toplink').hide();
$(window).scroll(function(){
var value = 200;
var scrolling = $(window).scrollTop();
if (scrolling > value) {
$('div.ce_toplink').fadeIn();
} else {
$('div.ce_toplink').fadeOut();
}
});
$('div.ce_toplink').click(function(){
$('html, body').animate({scrollTop:'0px'}, 1000);
return false;
});
});
</script>
CSS:
HTML-Code:
.ce_toplink{
clear:both;
font-size:12px;
vertical-align:middle;
padding:3px;
margin:2em 0 0 0;
}
.ce_toplink a {
color:#aaa;
text-decoration:none;
}
Viele Grüße
Tilda
Lesezeichen