码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-07-06 23:20:06      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:

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

技术分享
    
    <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

 

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

标签:

原文地址:http://www.cnblogs.com/shenchao/p/4625545.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!