link_on_hover

NAML documentation   Watch a video
   Usages of this macro
The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of "link_on_hover".
... in link_on_hover.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<override_macro name="link_on_hover" parameters="id,href,text">
    <n.put_in_head.>
        <script type="text/javascript">
<![CDATA[
            function createMouseTrick(nodeid) {
                $(document).ready(function() {
                    var $text = $('#hover-text'+nodeid);
                    var $link = $('#hover-link'+nodeid);
                    var entered = false;
                    var count = 0;
                    $text.mouseover(function() {
                        $(this).hide();
                        $link.show();
                        checkMouse();
                    });
 
                    $link.mouseover(function() {
                        entered = true;
                    });
 
                    $link.mouseout(function() {
                        $link.hide();
                        $text.show();
                        count = 0;
                        entered = false;
                    });
 
                    function checkMouse() {
                        if (!entered) {
                            count++;
                            if (count < 5) {
                                setTimeout(checkMouse, 100);
                            } else {
                                $link.hide();
                                $text.show();
                                count = 0;
                                entered = false;
                            }
                        }
                    }
                });
            };
]]>
        </script>
    </n.put_in_head.>
    <span id="hover-text[n.id/]"><n.text/></span>
    <script type="text/javascript">
        document.write('<a id="hover-link[n.id/]" href="[n.href/]" style="display:none">');
        document.write('<n.javascript_string_encode.get_app_node.text/>');
        document.write('</a>');
        createMouseTrick(<n.id/>);
    </script>
</override_macro>
Overrides default macro
... in app.naml
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
<macro name="link_on_hover" parameters="id,href,text">
    <n.put_in_head.>
        <script type="text/javascript">
<![CDATA[
            function createMouseTrick(nodeid) {
                $(document).ready(function() {
                    var $text = $('#hover-text'+nodeid);
                    var $link = $('#hover-link'+nodeid);
                    var entered = false;
                    var count = 0;
                    $text.mouseover(function() {
                        $(this).hide();
                        $link.show();
                        checkMouse();
                    });
 
                    $link.mouseover(function() {
                        entered = true;
                    });
 
                    $link.mouseout(function() {
                        $link.hide();
                        $text.show();
                        count = 0;
                        entered = false;
                    });
 
                    function checkMouse() {
                        if (!entered) {
                            count++;
                            if (count < 5) {
                                setTimeout(checkMouse, 100);
                            } else {
                                $link.hide();
                                $text.show();
                                count = 0;
                                entered = false;
                            }
                        }
                    }
                });
            };
]]>
        </script>
    </n.put_in_head.>
    <span id="hover-text[n.id/]"><n.text/></span>
    <script type="text/javascript">
        document.write('<a id="hover-link[n.id/]" href="[n.href/]" style="display:none">');
        document.write('<n.javascript_string_encode.get_app_node.text/>');
        document.write('</a>');
        createMouseTrick(<n.id/>);
    </script>
</macro>