// Adding a button to top

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10857 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-12-02 14:31:08 +00:00
parent a0a83e9e58
commit 8a62346471
7 changed files with 35 additions and 10 deletions
+17
View File
@@ -1000,4 +1000,21 @@ $(document).ready(function(){
if(!isArrowKey(e))
return copyMeta2friendlyURL()
});
// Adding a button to top
var scroll = $('#scrollTop a');
var view = $(window);
scroll.click(function(){
$.scrollTo('#top_container', 1200, { offset: -100 });
});
view.bind("scroll", function(e) {
var heightView = view.height();
var btnPlace = scroll.offset().top;
if (heightView < btnPlace)
scroll.show();
else
scroll.hide();
});
});