Skip to content

Instantly share code, notes, and snippets.

@tamoot
Created March 29, 2011 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamoot/892351 to your computer and use it in GitHub Desktop.
Save tamoot/892351 to your computer and use it in GitHub Desktop.
require_jquery
add_footer_proc do |date|
JQUERY_CODE=<<EOJ
<script type="text/javascript">
$(function() {
$(window).scroll(function(){
var scrollTop = $(window).scrollTop();
if(scrollTop != 0)
$('#adminmenu').stop().animate({'opacity':'0.2'},400);
else
$('#adminmenu').stop().animate({'opacity':'1'},400);
}
);
$('.adminmenu').hover(
// first argument
function (e) {
var scrollTop = $(window).scrollTop();
if(scrollTop != 0){
$('#adminmenu').stop().animate({'opacity':'1' },400);
}
},
// second argument
function (e) {
var scrollTop = $(window).scrollTop();
if(scrollTop != 0){
$('#adminmenu').stop().animate({'opacity':'0.2'},400);
}
}
);
});
</script>
EOJ
end
if /\A(?:latest|day|month|nyear)\z/ =~ @mode
def navi
result = %Q[<div class="adminmenu" id="adminmenu">\n]
result << navi_user
result << navi_admin
result << calendar
result << %Q[<span class="adminmenu"><a href="index.rdf"><img style="border-width: 0px;" src="/d/img/rss.png" alt="RSS feed"></a></span>]
result << %Q[</div>]
result << %Q[</div>\n]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment