easyui-tabs图标(获取焦点时显示图标,失去焦点时隐藏图标)

获取焦点时显示图标,失去焦点时隐藏图标

    
    <script type="text/javascript">

        $('#_progress').tabs({
            onSelect: function (title) {
                var tab = $('#_progress').tabs('getSelected');  // get selected panel

                var index = $('#_progress').tabs('getTabIndex', tab);
                //alert(index + title);
                var tabs = $('#_progress').tabs().tabs('tabs');
                for (var i = 0; i < tabs.length; i++) {
                    if (index == i) {
                        //alert(i);
                        $('#_progress').tabs('update', {
                            tab: tabs[i],
                            options: {
                                title: '<img src=\'images/accordion_arrows.png\'/>' + title
                                //href: 'get_content.php'  // the new content URL
                            }
                        });
                    }
                    else {
                        if (i == 0) {
                            $('#_progress').tabs('update', {
                                tab: tabs[i],
                                options: {
                                    title: '柱状图'
                                    //href: 'get_content.php'  // the new content URL
                                }
                            });
                        }
                        else {
                            $('#_progress').tabs('update', {
                                tab: tabs[i],
                                options: {
                                    title: '曲线图'
                                    //href: 'get_content.php'  // the new content URL
                                }
                            });
                        }
                    }
                }

            }
        });

        $(function () {
            var tabs = $('#_progress').tabs().tabs('tabs');
            for (var i = 0; i < tabs.length; i++) {
                tabs[i].panel('options').tab.unbind().bind('mouseenter', { index: i }, function (e) {
                    $('#_progress').tabs('select', e.data.index);
                });
            }
        });

    </script>
View Code

 

posted @ 2015-07-06 22:00  慧由心生  阅读(1256)  评论(0)    收藏  举报