- /**
- * @param sstr #searchCondition查找对像
- * @param obj #order .nan a被查找对像
- * @name mouseOver 页面效果 该函数 在模板被调用
- * @return null 如果页面有关键字查询,标记关键字
- */
- function doColor(sstr,obj) {
- str2 = $.trim($(sstr).val().replace(/;/g, ''));
- if (str2 == '')
- return;
- len = str2.length;
- $(obj).each(
- function() {
- str3 = $(this).text();
- str4 = '';
- for (i = 0; i < len; i++) {
- strk = $.trim(str2.charAt(i));
- if (strk != '') {
- str4 = ReplaceAll(str3, strk,
- '<b class="wrap">' + strk + '</b>');
- str3 = str4;
- }
- }
- $(this).html(str4);
- });
- }
- /**
- * @name ReplaceAll
- * @param String initStr 要替换的字符串
- * @param String rstr 被替换的字符串
- * @return String str 替换成的字符串
- */
- function ReplaceAll(initStr, rstr, rs) {
- str = '';
- while (initStr.indexOf(rstr) != -1) {
- k = initStr.indexOf(rstr);
- initStr = initStr.replace(rstr, rs);
- str += initStr.substr(0, k + rs.length);
- initStr = initStr.substr(k + rs.length);
- }
- str += initStr;
- return str;
- }