Subversion-Projekte lars-tiefland.marine-sales.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
$(document).ready(function () {
2
 
3
    function einblenden(){
4
        var topLvl = String( $(this).attr("id") );
5
        var topExpl = topLvl.split("_");
6
        var topId = topExpl[1];
7
        $('#li_'+topId).addClass('highlight');
8
 
9
        windowWidth = $(window).width();
10
        if( windowWidth > 850){
11
            $('.subnav').hide();
12
            $('#sub_'+topId).show();
13
            $(".topnav_ul li").removeClass('highlight');
14
 
15
        }
16
    }
17
 
18
    function ausblenden(){
19
        $('.subnav').hide();
20
        $(".topnav_ul li").removeClass('highlight');
21
    }
22
    function voidF() {
23
 
24
    }
25
    $(".topnav_ul li").hoverIntent({
26
        over: einblenden,
27
        out: voidF,
28
    });
29
 
30
    $('.subnav').hoverIntent({
31
        over: einblenden,
32
        out: ausblenden,
33
    });
34
    $('.header').hoverIntent({
35
        over: ausblenden,
36
        out: voidF,
37
    });
38
    $('.mainnav').hoverIntent({
39
        over: ausblenden,
40
        out: voidF,
41
    });
42
 
43
 
44
    $('.subnav').mouseleave(function(){
45
        $(this).hide();
46
    });
47
 
48
    $('.topnav_ul').mouseleave(function(e){
49
        e = e || window.e;
50
        xpos = e.pageX;
51
 
52
 
53
        var w = $(this).offset().left + $(this).width();
54
 
55
        if ( ( xpos < $(this).offset().left || xpos > w ) && $(".subnav").is(":visible")) {
56
            $(".subnav").hoverIntent({
57
                over: voidF,
58
                out: ausblenden,
59
            }).done(function(){
60
                $("li", this).removeClass('highlight');
61
            });
62
 
63
        } else if(!$(".subnav").is(":visible") ) {
64
            $("li", this).removeClass('highlight');
65
        }
66
 
67
    });
68
 
69
 
70
 
71
});