zoukankan      html  css  js  c++  java
  • 标题添加重要,最新,滞后图标

    需要在列表栏中的新闻标题添加重要,最新,  滞后图标,做了如下处理

    public static string getImg(object p, object t)
            {
                try
                {
                    string img = "";
                    int p_int = Convert.ToInt32(p.ToString());

                 //0 为重要 1最新 滞后通过DateTime.Compare来比较得出来的
                    if (p_int == 0)
                        img += "&nbsp;<img src='\\Images\\TaskImg\\zyrw.gif' title='重要' width=14 height=14 style='vertical-align: bottom;'>";

                   if (p_int == 1)
                        img += "&nbsp;<img src='\\Images\\TaskImg\\new.gif' title='最新' width=14 height=14 style='vertical-align: bottom;'>";

                    DateTime t_date = Convert.ToDateTime(t);
                    if (DateTime.Compare(Convert.ToDateTime(DateTime.Now.ToShortDateString()), t_date) > 0)
                        img += "&nbsp;<img src='\\Images\\TaskImg\\zhrw.gif' title='滞后' width=14 height=14 style='vertical-align: bottom;'>";

                    return img;
                }
                catch
                {
                    return "";
                }
            }

  • 相关阅读:
    关于字体单位em的问题
    键盘按钮keyCode大全
    右侧导航栏(动态添加数据到list)
    当前页面点击取到值
    前端写分页(用了自己同事写的插件)
    选择控件js插件和使用方法
    Form表单验证
    前端页面跳转并取到值
    App配置页面头部
    json字符串、json对象、数组之间的转换
  • 原文地址:https://www.cnblogs.com/Jack_G/p/2314136.html
Copyright © 2011-2022 走看看