demo.html
1.96 KB
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
54
55
56
57
58
59
60
<div id="noticebar" class="page out" data-title="通知公告插件">
    <div id="noticebar-header"></div>
    <div id="noticebar-a" style="margin-top:10px;"></div>
    <div id="noticebar-b" style="margin-top:10px;"></div>
</div>
<script>
require(["NavHeader", "NoticeBar"], function(NavHeader, NoticeBar) {
    var _u = require("mUtil");
    var hasClsPicker = typeof clsPicker !== "undefined";
    if(!hasClsPicker) {
        new NavHeader({
            el: "noticebar-header",
            option: {
                title:"通知公告插件", 
                smallTitle:"noticebar"
            }
        }).render();
    }
    new NoticeBar({
        el: "noticebar-a",
        option: {
            header: {
                icon: '/mobilemode/mobile/images/demo/notice.png',
            },
            items : [
                {content : "这是公告一内容,横向滚动"},
                {content : "这是公告二内容,横向滚动"},
                {content : "这是公告三内容,横向滚动"}
            ],
            direction: 'horizontal',//horizontal 横向 vertical 纵向
            callback : {
                click : function(data){
                    console.log(data);
                }
            }
        }
    }).render();
    if(!hasClsPicker) {
        new NoticeBar({
            el: "noticebar-b",
            option: {
                header: {
                    text: '通知公告'
                },
                items : [
                    {content : "这是公告一内容,纵向滚动"},
                    {content : "这是公告二内容,纵向滚动"},
                    {content : "这是公告三内容,纵向滚动"}
                ],
                direction: 'vertical',//horizontal 横向 vertical 纵向
                callback : {
                    click : function(data){
                        console.log(data);
                    }
                }
            }
        }).render();
    }
});
</script>