/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to Code Viewer Alt/index.js

  • Committer: Gustav Hartvigsson
  • Date: 2013-04-12 19:13:58 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20130412191358-lvnmll48cw7idkzk
added:
* COPYING - licensing information
* COPYRIGHT_HEADER - the header that should be in every file related to
  the project.
* README - Information about the project.
* lgpl-3.0 - The license that is used by this project.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
var menuTopOffset = 40;
 
2
var menuLeftOffset = 25;
 
3
 
 
4
$(document).ready(function() {
 
5
//      window.onresize = fixMenuLeft;
 
6
        //$('#menu').offset({ top: menuTopOffset, left: $('#menu').offset().left });
 
7
        //window.onscroll = moveMenu;
 
8
        $('#menuHeader').click(toggleMenu);/*
 
9
        
 
10
        */
 
11
        $("a.menuLink").click(function(event) {
 
12
                event.preventDefault();
 
13
                event.stopPropagation();
 
14
                var destination = event.target.href.substring(event.target.href.lastIndexOf('/') + 1);
 
15
                scrollTo(destination);
 
16
        });
 
17
        var sidebar = $('#sidebar');
 
18
        $(window).bind('scroll', function() {
 
19
                sidebar.css("top", $(window).scrollTop());
 
20
        });
 
21
        $('.ieCSS3Fix, .group h2').each(function() {
 
22
                if(PIE.attach) {
 
23
                        PIE.attach(this);
 
24
                }
 
25
        });
 
26
});
 
27
 
 
28
function fixMenuLeft(ev) {
 
29
        //$('#menu').offset({ top: bodyelem.scrollTop()+menuTopOffset, left: -($('#menu').width()-30) });
 
30
        if($('#menu').offset().left != 0) {
 
31
                $('#menu').offset({ top: $('#menu').offset().top, left: -($('#menu').width()-menuLeftOffset) });
 
32
        }
 
33
}
 
34
 
 
35
function toggleMenu(ev) {
 
36
        if($('#menu').offset().left == 0) {
 
37
                $('#menu').stop().animate({ left: -($('#menu').width()-menuLeftOffset) },{duration:900});
 
38
                $("#menuArrow").addClass("rotateArrowCW");
 
39
        } else {
 
40
                $('#menu').stop().animate({ left: 0 },{duration:900});
 
41
                $("#menuArrow").removeClass("rotateArrowCW");
 
42
        }
 
43
}
 
44
 
 
45
function moveMenu(ev){
 
46
        if($.browser.webkit) {
 
47
                bodyelem = $("body");
 
48
        } else {
 
49
                bodyelem = $("html,body");
 
50
        }
 
51
        $('#menu').offset({ top: bodyelem.scrollTop()+menuTopOffset, left: $('#menu').offset().left });
 
52
}
 
53
 
 
54
function scrollTo(id){
 
55
        $('html,body').animate({scrollTop: $("#"+id).offset().top},{duration:900});
 
56
        return false;
 
57
}
 
 
b'\\ No newline at end of file'