// Connected footer links and go-top

This commit is contained in:
Damien Metzger committed 2013-10-11 09:44:15 +02:00
1 parent 544423ea1e
commit 7f5f78a6f3
2 files changed
+27 -26

No files matched your search

+23 -6
View File
@@ -89,19 +89,17 @@ $( document ).ready(function() {
//nav switch //nav switch
function navSwitch(){ function navSwitch(){
if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed')) { if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed'))
navTopbar(); navTopbar();
} else { else
navSidebar(); navSidebar();
} }
}
//init menu //init menu
if ($('body').hasClass('page-sidebar')){ if ($('body').hasClass('page-sidebar'))
navSidebar(); navSidebar();
} else if($('body').hasClass('page-topbar')) { else if ($('body').hasClass('page-topbar'))
navTopbar(); navTopbar();
}
//tooltip //tooltip
$('.label-tooltip').tooltip(); $('.label-tooltip').tooltip();
@@ -112,4 +110,23 @@ $( document ).ready(function() {
$('.expanded').removeClass('expanded'); $('.expanded').removeClass('expanded');
}); });
function animateGoTop() {
if ($(window).scrollTop())
{
$('#go-top:hidden').stop(true, true).fadeIn();
$('#go-top:hidden').removeClass('hide');
}
else
$('#go-top').stop(true, true).fadeOut();
}
$("#go-top").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
$(window).scroll(function() {
animateGoTop();
});
animateGoTop();
}); });
+4 -20
View File
@@ -32,18 +32,15 @@
<a href="http://www.prestashop.com/" target="_blank">PrestaShop&trade; {$ps_version}</a> - <span>{l s='Load time: '} {number_format(microtime(true) - $timer_start, 3, '.', '')}s</span> <a href="http://www.prestashop.com/" target="_blank">PrestaShop&trade; {$ps_version}</a> - <span>{l s='Load time: '} {number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
</div> </div>
<div class="col-sm-2 hidden-xs social-networks"> <div class="col-sm-2 hidden-xs social-networks">
<a class="link-social link-twitter" href="#" title="Twitter"> <a class="link-social link-twitter" href="https://twitter.com/PrestaShop" title="Twitter">
<i class="icon-twitter"></i> <i class="icon-twitter"></i>
</a> </a>
<a class="link-social link-facebook" href="#" title="Facebook"> <a class="link-social link-facebook" href="https://www.facebook.com/prestashop" title="Facebook">
<i class="icon-facebook"></i> <i class="icon-facebook"></i>
</a> </a>
<a class="link-social link-github" href="#" title="Github"> <a class="link-social link-github" href="https://github.com/PrestaShop/PrestaShop/" title="Github">
<i class="icon-github"></i> <i class="icon-github"></i>
</a> </a>
<a class="link-social link-google" href="#" title="Google">
<i class="icon-google-plus"></i>
</a>
</div> </div>
<div class="col-sm-5"> <div class="col-sm-5">
@@ -57,20 +54,7 @@
<p> <p>
{/if} {/if}
</div> </div>
<div id="go-top"><i class="icon-arrow-up"></i></div> <div id="go-top" class="hide"><i class="icon-arrow-up"></i></div>
<script>
$("#go-top").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
$(window).scroll(function() {
if ($(this).scrollTop()) {
$('#go-top:hidden').stop(true, true).fadeIn();
} else {
$('#go-top').stop(true, true).fadeOut();
}
});
</script>
</div> </div>
{/if} {/if}
</body> </body>