PageSourceSearch

https://scottishmedicines.org.uk/scripts/menu-tabbing.js?cdv=971313061

js scottishmedicines.org.uk collected 2026-10-02 03:44:33 UTC 2,377 bytes, 78 lines download raw bytes

1
2
3$(window).keydown(function (e) {
4    var code = e.keyCode || e.which;
5
6    if (code === 9) {
7        menuFocus();
8    }
9    
10    /*if (code === 38) {
11        // UP
12        if ($("#main-menu li a").is(":focus")) {
13            event.preventDefault();
14            if ($(".dropdown li:first-of-type a").is(":focus")) {
15                $("a:focus").parent().parent().closest('li').find('a').focus();
16            }
17            if ($(".dropdown li a").is(":focus")) {
18                $("a:focus").closest('li').prev().find('a').focus();
19            }
20            else {
21                $("a:focus").closest('a').prev().focus();
22            }
23
24        }
25    }*/
26    /*if (code === 37) {
27        // LEFT
28        if ($("#main-menu li a").is(":focus")) {
29            event.preventDefault();
30            if ($(".dropdown li a").is(":focus")) {
31                $("a:focus").parent().parent().prev().find('a').focus();
32            }
33            else {
34                $("a:focus").closest('li').prev().find('a').focus();
35            }
36        }
37    }*/
38    /*if (code === 39) {
39        // RIGHT
40        if ($("#main-menu li a").is(":focus")) {
41            event.preventDefault();
42            if ($(".dropdown li a").is(":focus")) {
43                $("a:focus").parent().parent().closest('li').next().find('a').focus();
44            }
45            else {
46                $("a:focus").closest('li').next().find('a').focus();
47            }
48        }
49    }*/
50    /*if (code === 40) {
51        // DOWN
52        if ($("#main-menu li a").is(":focus")) {
53            event.preventDefault();
54            if ($(".dropdown li:last-of-type a").is(":focus")) {
55                $("a:focus").parent().parent().find('a').focus();
56            }
57            if ($(".dropdown li a").is(":focus")) {
58                $("a:focus").closest('li').next().find('a').focus();
59            }
60            else {
61                
62            }
63        }
64    }*/
65});
66
67
68function menuFocus() {
69    $('.dropdown li a').focus(function () {
70        $(this).parent().parent().parent().addClass('hover');
71        $(this).parent().parent().addClass('childfocus');
72    });
73
74    $('.dropdown li a').blur(function () {
75        $(this).parent().parent().parent().removeClass('hover');
76        $(this).parent().parent().removeClass('childfocus');
77    });
78}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.