scroll to top like a boss
This commit is contained in:
parent
e845bcf8e7
commit
72b734e3e8
3 changed files with 25 additions and 1 deletions
|
|
@ -107,6 +107,9 @@
|
||||||
%br
|
%br
|
||||||
= link_to t('.have_a_problem'), 'http://diaspora.shapado.com/'
|
= link_to t('.have_a_problem'), 'http://diaspora.shapado.com/'
|
||||||
|
|
||||||
|
%a{:id=>"back-to-top", :title=>"Back to top", :href=>"#"}
|
||||||
|
⇧
|
||||||
|
|
||||||
-if !@landing_page && request.url.match(/joindiaspora.com/)
|
-if !@landing_page && request.url.match(/joindiaspora.com/)
|
||||||
:javascript
|
:javascript
|
||||||
var is_ssl = ("https:" == document.location.protocol);
|
var is_ssl = ("https:" == document.location.protocol);
|
||||||
|
|
@ -122,4 +125,3 @@
|
||||||
feedback_widget_options.color = "#222";
|
feedback_widget_options.color = "#222";
|
||||||
feedback_widget_options.style = "idea";
|
feedback_widget_options.style = "idea";
|
||||||
var feedback_widget = new GSFN.feedback_widget(feedback_widget_options);
|
var feedback_widget = new GSFN.feedback_widget(feedback_widget_options);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,17 @@ var View = {
|
||||||
$('#main_stream label').inFieldLabels();
|
$('#main_stream label').inFieldLabels();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*scroll to top */
|
||||||
|
jQuery(window).scroll(function(){
|
||||||
|
if(jQuery(window).scrollTop() > 1000){
|
||||||
|
// show back to top
|
||||||
|
jQuery('#back-to-top').stop().animate({opacity: 1});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// hide back to top
|
||||||
|
jQuery('#back-to-top').stop().animate({opacity: 0});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/* Showing debug messages */
|
/* Showing debug messages */
|
||||||
$(this.debug.selector)
|
$(this.debug.selector)
|
||||||
|
|
|
||||||
|
|
@ -3367,3 +3367,14 @@ ul#getting_started
|
||||||
.accept_invitation_text
|
.accept_invitation_text
|
||||||
:font
|
:font
|
||||||
:weight lighter
|
:weight lighter
|
||||||
|
#back-to-top
|
||||||
|
:display block
|
||||||
|
:color white
|
||||||
|
:position fixed
|
||||||
|
:right 20px
|
||||||
|
:top 50px
|
||||||
|
:opacity 0
|
||||||
|
:font-size 3em
|
||||||
|
:padding 0 12px 0 12px
|
||||||
|
:border-radius 10px
|
||||||
|
:background-color #82D400
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue