• 那些年被坑过的问题


    1.js在拼接字符的过程中 ,不能以对象的形式上传递参数。

    function setData(obj){var imgpath="javascript:this.src='${base}/before/img/1.png'";
        var div_show="<div class='achd_baominging'><div class='achd_img'>";
        div_show+="<img src='${base}"+obj.image+"'  onerror="+imgpath+" onclick='open_data("+obj.id+","+obj.ac_end+")'/></div>";
        div_show+="<div class='achd_info'><div class='achd_title'><span class='title_one'>"+obj.title+"</span><br/>";
        div_show+="<span class='title_two'>"+obj.summary+"</span></div>";
        //判断报名按钮是否显示
        if(obj.ac_end=='01'){
            div_show+="<div class='achd_btn'><button>报名中</button></div></div>";
        }else{
            div_show+="<div class='achd_endbtn'><button>已结束</button></div></div>";
        }
        return div_show;
    }

    这里的onclick事件的参数传递不能是object类型的数据

    2.背景图片更换

     $(this).css('background','#1874CD');

    3.div 显示仅仅是一行的数据

     .title_one{
        font-size: 15px;
        font-weight: bold;
         100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
  • 相关阅读:
    Git 最全命令使用
    git 配置(实用)
    用Redis进行实时数据排名
    最长上升子序列
    KMP算法
    计算星期几【基姆拉尔森公式】
    集合划分(贝尔数)
    合数分解(质因数分解)
    乘法逆元
    扩展欧几里得算法
  • 原文地址:https://www.cnblogs.com/save-shengfei/p/6733713.html
Copyright © 2020-2023  润新知