/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-04 18:10:23 UTC
  • mfrom: (12.2.4 lenasys)
  • Revision ID: gustav.hartvigsson@gmail.com-20130404181023-um5z5jx0jwth4hv9
Merging with implementation group 2's branch, containts an error,
will be fixed. (hopefully).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
var menuLeftOffset = 25;
3
3
 
4
4
$(document).ready(function() {
5
 
        window.onresize = fixMenuLeft;
 
5
//      window.onresize = fixMenuLeft;
6
6
        //$('#menu').offset({ top: menuTopOffset, left: $('#menu').offset().left });
7
7
        //window.onscroll = moveMenu;
8
 
        $('#menuHeader').click(toggleMenu);
 
8
        $('#menuHeader').click(toggleMenu);/*
 
9
        
 
10
        */
9
11
        $("a.menuLink").click(function(event) {
10
12
                event.preventDefault();
11
13
                event.stopPropagation();
12
14
                var destination = event.target.href.substring(event.target.href.lastIndexOf('/') + 1);
13
15
                scrollTo(destination);
14
16
        });
 
17
        var sidebar = $('#sidebar');
 
18
        $(document).bind('scroll', function() {
 
19
                sidebar.css("top", $(window).scrollTop());
 
20
        });
 
21
        $('.ieCSS3Fix, .menuLink').each(function() {
 
22
                PIE.attach(this);
 
23
        });
15
24
});
16
25
 
17
26
function fixMenuLeft(ev) {
23
32
 
24
33
function toggleMenu(ev) {
25
34
        if($('#menu').offset().left == 0) {
26
 
                $('#menu').animate({ left: -($('#menu').width()-menuLeftOffset) },{duration:900});
 
35
                $('#menu').stop().animate({ left: -($('#menu').width()-menuLeftOffset) },{duration:900});
27
36
                $("#menuArrow").addClass("rotateArrowCW");
28
37
        } else {
29
 
                $('#menu').animate({ left: 0 },{duration:900});
 
38
                $('#menu').stop().animate({ left: 0 },{duration:900});
30
39
                $("#menuArrow").removeClass("rotateArrowCW");
31
40
        }
32
41
}