// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
#http://www.pfizerpro.com/content/showlabeling.asp?id=134 (accessed on 11 Feb 2011) ##http://www.gsk.com.au/resources.ashx/vaccineproductschilddataproinfo/142/ FileName/22A0C4A5B2DB8AEA1336C4BC927E6530/PI_Synflorix.pdf (accessed on 11 Feb 2011) ### No figure available yet. Assume to be similar to Prevnar® . *http://www.chp.gov.hk/files/pdf/recommendations_on_the_interchangeability_between_pcv7_and_pcv10.pdf (accessed on 11 Feb 2011) ** http://web.cdc.gov.tw/public/Data/11617444371.pdf *** http://www.news.gov.hk/tc/categories/health/html/2011/11/20111129_162933.shtml
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}
// JavaScript Document <!– /* Script by: http://www.jtricks.com * Version: 20071017 * Latest version: * http://www.jtricks.com/javascript/navigation/floating.html */ var floatingMenuId = 'floatdiv'; var floatingMenu = { targetX: 0, targetY: 300, hasInner: typeof(window.innerWidth) == 'number', hasElement: typeof(document.documentElement) == 'object' && typeof(document.documentElement.clientWidth) == 'number', menu: document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId] }; floatingMenu.move = function () { floatingMenu.menu.style.left = floatingMenu.nextX + 'px'; floatingMenu.menu.style.top = floatingMenu.nextY + 'px'; } floatingMenu.computeShifts = function () { var de = document.documentElement; floatingMenu.shiftX = floatingMenu.hasInner ? pageXOffset : floatingMenu.hasElement ? de.scrollLeft : document.body.scrollLeft; if (floatingMenu.targetX < 0) { floatingMenu.shiftX += floatingMenu.hasElement ? de.clientWidth : document.body.clientWidth; } floatingMenu.shiftY = floatingMenu.hasInner ? pageYOffset : floatingMenu.hasElement ? de.scrollTop : document.body.scrollTop; if (floatingMenu.targetY window.innerHeight ? window.innerHeight : de.clientHeight } else { floatingMenu.shiftY += floatingMenu.hasElement ? de.clientHeight : document.body.clientHeight; } } } floatingMenu.calculateCornerX = function() { if (floatingMenu.targetX != ‘center’) return floatingMenu.shiftX + floatingMenu.targetX; var width = parseInt(floatingMenu.menu.offsetWidth); var cornerX = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageXOffset : document.documentElement.scrollLeft) + (document.documentElement.clientWidth – width)/2 : document.body.scrollLeft + (document.body.clientWidth – width)/2; return cornerX; }; floatingMenu.calculateCornerY = function() { if (floatingMenu.targetY != ‘center’) return floatingMenu.shiftY + floatingMenu.targetY; var height = parseInt(floatingMenu.menu.offsetHeight); // Handle Opera 8 problems var clientHeight = floatingMenu.hasElement && floatingMenu.hasInner && document.documentElement.clientHeight > window.innerHeight ? window.innerHeight : document.documentElement.clientHeight var cornerY = floatingMenu.hasElement ? (floatingMenu.hasInner ? pageYOffset : document.documentElement.scrollTop) + (clientHeight – height)/2 : document.body.scrollTop + (document.body.clientHeight – height)/2; return cornerY; }; floatingMenu.doFloat = function() { // Check if reference to menu was lost due // to ajax manipuations if (!floatingMenu.menu) { menu = document.getElementById ? document.getElementById(floatingMenuId) : document.all ? document.all[floatingMenuId] : document.layers[floatingMenuId]; initSecondary(); } var stepX, stepY; floatingMenu.computeShifts(); var cornerX = floatingMenu.calculateCornerX(); var stepX = (cornerX – floatingMenu.nextX) * .07; if (Math.abs(stepX) < .5) { stepX = cornerX – floatingMenu.nextX; } var cornerY = floatingMenu.calculateCornerY(); var stepY = (cornerY – floatingMenu.nextY) * .07; if (Math.abs(stepY) 0 || Math.abs(stepY) > 0) { floatingMenu.nextX += stepX; floatingMenu.nextY += stepY; floatingMenu.move(); } setTimeout(‘floatingMenu.doFloat()’, 20); }; // addEvent designed by Aaron Moore floatingMenu.addEvent = function(element, listener, handler) { if(typeof element[listener] != ‘function’ || typeof element[listener + ‘_num’] == ‘undefined’) { element[listener + ‘_num’] = 0; if (typeof element[listener] == ‘function’) { element[listener + 0] = element[listener]; element[listener + ‘_num’]++; } element[listener] = function(e) { var r = true; e = (e) ? e : window.event; for(var i = element[listener + ‘_num’] -1; i >= 0; i–) { if(element[listener + i](e) == false) r = false; } return r; } } //if handler is not already stored, assign it for(var i = 0; i /*—————————————-* * 参数说明: * obj: 对象, 要进行高亮显示的html标签节点. * hlWords: 字符串, 要进行高亮的关键词词, 使用 竖杠(|)或空格 分隔多个词 . * cssClass: 字符串, 定义关键词突出显示风格的css伪类. * 参考资料: javascript HTML DOM 高亮显示页面特定字词 \*—————————————-*/ function MarkHighLight(obj, hlWords, cssClass) { hlWords = AnalyzeHighLightWords(hlWords); if (obj == null || hlWords.length == 0) return; if (cssClass == null) cssClass = “highlight”; MarkHighLightCore(obj, hlWords); //————执行高亮标记的核心方法—————————- function MarkHighLightCore(obj, keyWords) { var re = new RegExp(keyWords, “i”); for (var i = 0; i < obj.childNodes.length; i++) { var childObj = obj.childNodes[i]; if (childObj.nodeType == 3) { if (childObj.data.search(re) == -1) continue; var reResult = new RegExp("(" + keyWords + ")", "gi"); var objResult = document.createElement("span"); objResult.innerHTML = childObj.data.replace(reResult, "$1“); if (childObj.data == objResult.childNodes[0].innerHTML) continue; obj.replaceChild(objResult, childObj); } else if (childObj.nodeType == 1) { MarkHighLightCore(childObj, keyWords); } } } //———-分析关键词———————- function AnalyzeHighLightWords(hlWords) { if (hlWords == null) return “”; hlWords = hlWords.replace(/\s+/g, “|”).replace(/\|+/g, “|”); hlWords = hlWords.replace(/(^\|*)|(\|*$)/g, “”); if (hlWords.length == 0) return “”; var wordsArr = hlWords.split(“|”); if (wordsArr.length > 1) { var resultArr = BubbleSort(wordsArr); var result = “”; for (var i = 0; i < resultArr.length; i++) { result = result + "|" + resultArr[i]; } return result.replace(/(^\|*)|(\|*$)/g, ""); } else { return hlWords; } } //—–利用冒泡排序法把长的关键词放前面—– function BubbleSort(arr) { var temp, exchange; for (var i = 0; i = i; j–) { if ((arr[j + 1].length) > (arr[j]).length) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; exchange = true; } } if (!exchange) break; } return arr; } } //—————-end———————— var divObj = document.getElementById(“content”); MarkHighLight(divObj, ‘文章|关键|功能’);
Keyword:美容,生活,购物 var autoTags = new AUTOTAGS.createTagger({}); // Create an instance of the AutoTags tagger autoTags.COMPOUND_TAG_SEPARATOR = ‘_’; // var tagSet = autoTags.analyzeText( ‘text to suggest tags for…’, 10 ); // for ( var t in tagSet.tags ) { var tag = tagSet.tags[t]; … tag.getValue(); // The tag itself }aaaa,/script> .photoleft {float: left; padding:2px 0px 8px 10px; margin: 0; font-size:90%; color: #783f04; font-style:italic; width: 450px;}