/*! * myPagination Jquery Pagination Plug-in Library v5.0 * * http://linapex.blog.163.com/blog/#m=0&t=1&c=fks_084071082080087067080095087095085094088065087081083066082 * * Date: 2012/9/24 21:20 */ (function($) { $.fn.myPagination = function(param) { return init(param,$(this)); }; // opts 代表所有参数 // obj 代表当前对象 // init 方法 采用闭包概念 function init(param,obj){ //默认配置 var defaults = { currPage: 1, pageCount: 10, pageNumber: 5, pageSize : 10, sortnameParmName : "sortname", sortorderParmName : "sortorder", colnums:[], cssStyle: 'badoo', ajax: { on: false, type : "POST", pageCountId: 'pageCount', url: "jsonTest.php", dataType: 'json', param: false, onClick:function(){ return false; }, ajaxStart: function() { return false; }, callback: function (data){ return false; } }, panel: { first: '首页', last: '尾页', next: '下一页', prev: '上一页', first_on: true, last_on: true, next_on: true, prev_on: true, links: '#', tipInfo_on: false, tipInfo: '  跳{currText}/{sumPage}页', tipInfo_css: { width: '22px' } } }; //得到参数 function getParam() { var param = "page="+opts.currPage+"&pagesize="+opts.pageSize; if(opts.sortName){ if(!opts.sortOrder) opts.sortOrder = "asc"; param += "&sortname=" + opts.sortName+"&sortorder="+opts.sortOrder; } if (opts.ajax.param) { param += "&" + opts.ajax.param; } return param; } //检查输入页数 function checkInputPage(val) { var msg ; if (val < 1) { msg = "输入值不能小于1"; } var patrn = /^[0-9]{1,8}$/; if (!patrn.exec(val)) { msg = "请输入正确的数字"; } if (val > opts.pageCount) { msg = "输入值不能大于总页数"; } if(msg){ alert(msg); return false; } return true; } //得到面板提示信息 function getPanelTipInfo() { var str = ""; if(opts.panel.tipInfo_on){ var input = ""; //info内容   跳{currText}/{sumPage}页 var info = opts.panel.tipInfo; info = info.replace("{currText}", input); info = info.replace("{sumPage}", opts.pageCount); info = $(info); input = info.children(":text:first"); var css = opts.panel.tipInfo_css; for (var temp in css) { var val = eval("css." + temp); input.css(temp, val); } str = info.html(); } return str; } //开始请求 function onRequest(){ if(opts.ajax.on){ //开启了ajax请求有效 opts.ajax.ajaxStart(); $.ajax({ url: opts.ajax.url, // 请求Url地址 type: opts.ajax.type, // 提交数据方式 data: getParam(), // 参数 contentType: "application/x-www-form-urlencoded;utf-8", // 发送信息给服务器编码类型 async: true, // 异步 cache: false, // 不缓存 timeout: 20000, // 超时时间 error: function() { var data = []; responseHandle(data); //obj.html(""); //alert("访问服务器超时,请重试,谢谢!"); }, success: function(data) { responseHandle(data); if(data){ createPageBar(); }else{ obj.html(""); } } }); }else{ obj.html("对不起,网络繁忙暂时未能加载出来数据,点击查询重新加载"); //createPageBar(); } } //返回处理 function responseHandle(data){ var pageCountId = opts.ajax.pageCountId; var resultPageCount = 1; //设置为1 var rstotalCount = 0; switch (opts.ajax.dataType) { case "json": try{ data = eval("(" + data + ")"); // 转换为对象 }catch(err){ }finally{ resultPageCount = eval("data." + pageCountId); rstotalCount = eval("data.totalCount"); } break; case "xml": resultPageCount = $(data).find(pageCountId).text(); break; default: resultPageCount = $(data).find(":hidden[id='"+pageCountId+"']").val(); break; } debug(opts.id); debug("返回总页数:"+resultPageCount); opts.pageCount = resultPageCount; opts.totalCount = rstotalCount; opts.ajax.callback(data); } // 得到页码操作 function createPageBar() { var links = opts.panel.links; opts.currPage = opts.currPage > opts.pageCount ? opts.pageCount : opts.currPage; var currPage = opts.currPage; var pageCount = parseInt(opts.pageCount); var tempPage = parseInt (opts.pageNumber / 2); var pageNumber = opts.pageNumber; var str = ""; //首页 if (opts.panel.first_on) { str = "" + opts.panel.first + ""; } // 上一页 if (opts.panel.prev_on) { if (currPage == 1) { str += "" + opts.panel.prev + " "; } else { str += "" + opts.panel.prev + " "; } } // 开始页和最后页 var firstPage = lastPage = 1; // 当前页 - 中间数 > 0,则开始页 = 当前页 - 中间数,否则 开始页 = 1 firstPage = currPage - tempPage > 0 ? firstPage = currPage - tempPage : 1; // 开始页 + 显示页数 > 总页数,则 最后页 = 最后页 +1,开始页 = 最后页 - 显示页,否则 最后页 = 开始页 + // 显示页 if (firstPage + pageNumber > pageCount) { lastPage = pageCount + 1; firstPage = lastPage - pageNumber; } else { lastPage = firstPage + pageNumber; } //防止开始页数低于1 if (firstPage <= 0) { firstPage = 1; } // 生成链接 // 这里的 firstPage 需要看成是 currPage ,每一页都是当前页,生成链接。 for (firstPage; firstPage < lastPage; firstPage++) { if (firstPage == currPage) { str += "" + firstPage + "";; } else { str += "" + firstPage + ""; } } //下一页 if(opts.panel.next_on){ if (currPage == pageCount) { str += "" + opts.panel.next + " "; } else { str += "" + opts.panel.next + " "; } } //尾页 if(opts.panel.last_on){ str += "" + opts.panel.last + ""; } var count = 0; if(opts.totalCount) {count = opts.totalCount}; str += "     总共 "+count+" 条"; str += getPanelTipInfo(); debug(opts.id); debug("最终生成菜单:"); debug(str); obj.html(str); //文本框增加事件 obj.children(":text").keypress(function(event) { var keycode = event.which; if (keycode == 13) { var page = $(this).val(); //验证输入值 if (checkInputPage(page)) { //回车事件时,去除其他 a 标签的 click 事件 obj.children("a").unbind("click"); // 去除 所有 a 标签 click //再次绑定click 事件 obj.children("a").each(function() { $(this).click(function() { return false; }); }); opts.currPage = page; onRequest(); //发送请求 } } }); // 增加事件 obj.children("a").each(function(index,element) { //给与每个a 标签 增加 单击事件 $(this).click(function() { //得到当前页数,以 title 属性为容器存放 var page = parseInt(this.title); page = page > 0 ? page : 1; //单击某一个 a 标签时,去除其他 a 标签的 click 事件 obj.children("a").unbind("click"); // 去除 所有 a 标签 click //再次绑定click 点击无效事件 obj.children("a").each(function() { $(this).click(function() { return false; }); }); opts.currPage = page; opts.ajax.onClick(page); onRequest(); //发送请求 $(this).focus(); return false; }); // click }); } //debug 调试 function debug(str){ $.fn.debug(str); } //目标对象拥有了所有源对象所拥有的特性,可理解为继承 // true 为深度拷贝,将子对象进行合并 var opts = $.extend(true,defaults, param); opts.id = obj.attr("id"); //得到id // 添加样式 obj.addClass(opts.cssStyle); //createTitle();//根据listarea得到列表区域进行列表头的组件 //组件列表体 // alert($('#'+opts.listarea).html()); //开始请求 onRequest(); var method = {}; //方法 method.getPage = function(){ return this.currPage; } method.onReload = function(){ debug("reload()"); onRequest(); } //指定加载数据 method.onLoad = function(param){ var params = []; if(param && param instanceof Object ){ opts.currPage = 1; if(param){ opts.ajax.param = param.param; } onRequest(); } } method.changeSort = function(columnName, sortOrder) { opts.sortName = columnName; opts.sortOrder = sortOrder; onRequest(); } //跳转指定页面 method.jumpPage = function(page){ page = page < 1 ? 1 : page; //如果page小于1,就为1 page = page > opts.pageCount ? opts.pageCount : page; //如果page大于pageCount则为pageCount opts.currPage = page; onRequest(); } return method; } $.fn.debug = function(str){ if(window.console && window.console.log){ console.log(str); } } })(jQuery); window.ZENG=window.ZENG || {}; ZENG.dom = {getById: function(id) { return document.getElementById(id); },get: function(e) { return (typeof (e) == "string") ? document.getElementById(e) : e; },createElementIn: function(tagName, elem, insertFirst, attrs) { var _e = (elem = ZENG.dom.get(elem) || document.body).ownerDocument.createElement(tagName || "div"), k; if (typeof (attrs) == 'object') { for (k in attrs) { if (k == "class") { _e.className = attrs[k]; } else if (k == "style") { _e.style.cssText = attrs[k]; } else { _e[k] = attrs[k]; } } } insertFirst ? elem.insertBefore(_e, elem.firstChild) : elem.appendChild(_e); return _e; },getStyle: function(el, property) { el = ZENG.dom.get(el); if (!el || el.nodeType == 9) { return null; } var w3cMode = document.defaultView && document.defaultView.getComputedStyle, computed = !w3cMode ? null : document.defaultView.getComputedStyle(el, ''), value = ""; switch (property) { case "float": property = w3cMode ? "cssFloat" : "styleFloat"; break; case "opacity": if (!w3cMode) { var val = 100; try { val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity; } catch (e) { try { val = el.filters('alpha').opacity; } catch (e) { } } return val / 100; } else { return parseFloat((computed || el.style)[property]); } break; case "backgroundPositionX": if (w3cMode) { property = "backgroundPosition"; return ((computed || el.style)[property]).split(" ")[0]; } break; case "backgroundPositionY": if (w3cMode) { property = "backgroundPosition"; return ((computed || el.style)[property]).split(" ")[1]; } break; } if (w3cMode) { return (computed || el.style)[property]; } else { return (el.currentStyle[property] || el.style[property]); } },setStyle: function(el, properties, value) { if (!(el = ZENG.dom.get(el)) || el.nodeType != 1) { return false; } var tmp, bRtn = true, w3cMode = (tmp = document.defaultView) && tmp.getComputedStyle, rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; if (typeof (properties) == 'string') { tmp = properties; properties = {}; properties[tmp] = value; } for (var prop in properties) { value = properties[prop]; if (prop == 'float') { prop = w3cMode ? "cssFloat" : "styleFloat"; } else if (prop == 'opacity') { if (!w3cMode) { prop = 'filter'; value = value >= 1 ? '' : ('alpha(opacity=' + Math.round(value * 100) + ')'); } } else if (prop == 'backgroundPositionX' || prop == 'backgroundPositionY') { tmp = prop.slice(-1) == 'X' ? 'Y' : 'X'; if (w3cMode) { var v = ZENG.dom.getStyle(el, "backgroundPosition" + tmp); prop = 'backgroundPosition'; typeof (value) == 'number' && (value = value + 'px'); value = tmp == 'Y' ? (value + " " + (v || "top")) : ((v || 'left') + " " + value); } } if (typeof el.style[prop] != "undefined") { el.style[prop] = value + (typeof value === "number" && !rexclude.test(prop) ? 'px' : ''); bRtn = bRtn && true; } else { bRtn = bRtn && false; } } return bRtn; },getScrollTop: function(doc) { var _doc = doc || document; return Math.max(_doc.documentElement.scrollTop, _doc.body.scrollTop); },getClientHeight: function(doc) { var _doc = doc || document; return _doc.compatMode == "CSS1Compat" ? _doc.documentElement.clientHeight : _doc.body.clientHeight; } }; ZENG.string = {RegExps: {trim: /^\s+|\s+$/g,ltrim: /^\s+/,rtrim: /\s+$/,nl2br: /\n/g,s2nb: /[\x20]{2}/g,URIencode: /[\x09\x0A\x0D\x20\x21-\x29\x2B\x2C\x2F\x3A-\x3F\x5B-\x5E\x60\x7B-\x7E]/g,escHTML: {re_amp: /&/g,re_lt: //g,re_apos: /\x27/g,re_quot: /\x22/g},escString: {bsls: /\\/g,sls: /\//g,nl: /\n/g,rt: /\r/g,tab: /\t/g},restXHTML: {re_amp: /&/g,re_lt: /</g,re_gt: />/g,re_apos: /&(?:apos|#0?39);/g,re_quot: /"/g},write: /\{(\d{1,2})(?:\:([xodQqb]))?\}/g,isURL: /^(?:ht|f)tp(?:s)?\:\/\/(?:[\w\-\.]+)\.\w+/i,cut: /[\x00-\xFF]/,getRealLen: {r0: /[^\x00-\xFF]/g,r1: /[\x00-\xFF]/g},format: /\{([\d\w\.]+)\}/g},commonReplace: function(s, p, r) { return s.replace(p, r); },format: function(str) { var args = Array.prototype.slice.call(arguments), v; str = String(args.shift()); if (args.length == 1 && typeof (args[0]) == 'object') { args = args[0]; } ZENG.string.RegExps.format.lastIndex = 0; return str.replace(ZENG.string.RegExps.format, function(m, n) { v = ZENG.object.route(args, n); return v === undefined ? m : v; }); }}; ZENG.object = { routeRE: /([\d\w_]+)/g, route: function(obj, path) { obj = obj || {}; path = String(path); var r = ZENG.object.routeRE, m; r.lastIndex = 0; while ((m = r.exec(path)) !== null) { obj = obj[m[0]]; if (obj === undefined || obj === null) { break; } } return obj; }}; var ua = ZENG.userAgent = {}, agent = navigator.userAgent; ua.ie = 9 - ((agent.indexOf('Trident/5.0') > -1) ? 0 : 1) - (window.XDomainRequest ? 0 : 1) - (window.XMLHttpRequest ? 0 : 1); if (typeof (ZENG.msgbox) == 'undefined') { ZENG.msgbox = {}; } ZENG.msgbox._timer = null; ZENG.msgbox.loadingAnimationPath = ZENG.msgbox.loadingAnimationPath || ("/get56n/css/images/msgbox/loading.gif"); ZENG.msgbox.show = function(msgHtml, type, timeout, opts) { if (typeof (opts) == 'number') { opts = {topPosition: opts}; } opts = opts || {}; var _s = ZENG.msgbox, template = '', loading = '', typeClass = [0, 0, 0, 0, "succ", "fail", "clear"], mBox, tips; _s._loadCss && _s._loadCss(opts.cssPath); mBox = ZENG.dom.get("q_Msgbox") || ZENG.dom.createElementIn("div", document.body, false, {className: "zeng_msgbox_layer_wrap"}); mBox.id = "q_Msgbox"; mBox.style.display = ""; mBox.innerHTML = ZENG.string.format(template, {type: typeClass[type] || "hits",msgHtml: msgHtml || "",loadIcon: type == 6 ? loading : ""}); _s._setPosition(mBox, timeout, opts.topPosition); }; ZENG.msgbox._setPosition = function(tips, timeout, topPosition) { timeout = timeout || 5000; var _s = ZENG.msgbox, bt = ZENG.dom.getScrollTop(), ch = ZENG.dom.getClientHeight(), t = Math.floor(ch / 2) - 40; ZENG.dom.setStyle(tips, "top", ((document.compatMode == "BackCompat" || ZENG.userAgent.ie < 7) ? bt : 0) + ((typeof (topPosition) == "number") ? topPosition : t) + "px"); clearTimeout(_s._timer); tips.firstChild.style.display = ""; timeout && (_s._timer = setTimeout(_s.hide, timeout)); }; ZENG.msgbox.hide = function(timeout) { var _s = ZENG.msgbox; if (timeout) { clearTimeout(_s._timer); _s._timer = setTimeout(_s._hide, timeout); } else { _s._hide(); } }; ZENG.msgbox._hide = function() { var _mBox = ZENG.dom.get("q_Msgbox"), _s = ZENG.msgbox; clearTimeout(_s._timer); if (_mBox) { var _tips = _mBox.firstChild; ZENG.dom.setStyle(_mBox, "display", "none"); } }; (function ($) { var hasResult = false; var currentSelect = ""; var selectedCity = ""; String.prototype.trim = function () { //自定义的trim方法 防止浏览器兼容性造成的问题 2012-10-9 Lzz return this.replace(/^\s+|\s+$/g, ''); } $.suggest = function (input, options) { //var $input = $(input).attr("autocomplete", "off"); var $input = $(input); var $results; var timeout = false; // hold timeout ID for suggestion results to appear var prevLength = 0; // last recorded length of $input.val() var cache = []; // cache MRU list var cacheSize = 0; // size of cache in chars (bytes?) if ($.trim($input.val()) == '' || $.trim($input.val()) == '中文/英文') $input.val('').css('color', '#aaa'); if (!options.attachObject) options.attachObject = $(document.createElement("ul")).appendTo('body'); $results = $(options.attachObject); $results.addClass(options.resultsClass); //resetPosition(); //$(window) //.load(resetPosition) // just in case user is changing size of page while loading //.resize(resetPosition); $input.blur(function () { /*********update at 2011-12-23 ,默认第一个**********/ /*if ($(this).val().length == 0) { hasResult = false; } if (hasResult) { $(input).val(currentSelect).css('color', '#000'); hasResult = false; currentSelect = ""; } else { $(this).val("中文/拼音").css('color', '#aaa'); }*/ /****************************************************/ var $value = $input.val(); if( $value=="" || $value.length == 0){ $('input[name='+$input[0].id+']').val(''); }else{ var $val = $('input[name='+$input[0].id+']').val(); if(($value.length > 0 && !hasResult) || $val.length == 0){ $input.val(''); } } setTimeout(function () { $results.hide(); }, 200); }); $input.focus(function () { if ($.trim($(this).val()) == '中文/英文') { $(this).val('').css('color', '#000'); } if ($.trim($(this).val()) == '') { displayItems('',options.listSize,options.parentVal); //显示热门城市列表 } }); $input.click(function () { var q = $.trim($(this).val()); displayItems(q,options.listSize,options.parentVal); $(this).select(); }); // help IE users if possible try { $results.bgiframe(); } catch (e) { } $input.keyup(processKey); // // function resetPosition() { // // requires jquery.dimension plugin // var offset = $input.offset(); // $results.css({ // top: (offset.top + input.offsetHeight) + 'px', // left: offset.left + 'px' // }); // } function processKey(e) { // handling up/down/escape requires results to be visible // handling enter/tab requires that AND a result to be selected if ((/27$|38$|40$/.test(e.keyCode) && $results.is(':visible')) || (/^13$|^9$/.test(e.keyCode) && getCurrentResult())) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); e.cancelBubble = true; e.returnValue = false; switch (e.keyCode) { case 38: // up prevResult(); break; case 40: // down nextResult(); break; case 13: // return selectCurrentResult(); break; case 27: // escape $results.hide(); break; } } else if ($input.val().length != prevLength) { if (timeout) clearTimeout(timeout); timeout = setTimeout(suggest, options.delay); prevLength = $input.val().length; } } function suggest() { var q = $.trim($input.val()); displayItems(q,options.listSize,options.parentVal); } function displayItems(items,size,parentname) { var parentVal = null; if(parentname){ //用于联动 var pp_val = $('#'+parentname).val(); if(pp_val.length > 0){ parentVal = pp_val; } } var html = ''; var listsize = size||10; var iframe_attach = ""; var current_broswer = navigator.userAgent.toLowerCase(); if (current_broswer.match(/msie ([6.]+)/)) {//如果是ie6 //231px对应10个提示选项和一个tip头(提示项和tip头都是21px) iframe_attach = ""; } if (items == '') {//热门城市遍历 var count = 0; for (h in options.hot_list) { if (null != options.hot_list[h][0]&& (parentVal==null || parentVal== options.hot_list[h][0] )) { html += '
  • ' + options.hot_list[h][1] + '' + options.hot_list[h][2] + '' + options.hot_list[h][3] + '
  • '; count++; if (count == size) { break; } } } html = iframe_attach + '
    请输入中文/英文或者↑↓选择
    '; } else { /*if (!items) return; if (!items.length) { $results.hide(); return; }*/ var jSum = 0; for (var i = 0; i < options.source.length; i++) {//国内城市匹配 var reg = new RegExp('^' + items + '.*$', 'im'); if (reg.test(options.source[i][0]) || reg.test(options.source[i][1]) || reg.test(options.source[i][2]) || reg.test(options.source[i][3])) { if(parentVal==null || parentVal == options.source[i][0] ) { html += '
  • ' + options.source[i][1] + '' + options.source[i][2] + '' + options.source[i][3] + '
  • '; } jSum++; } if (jSum == listsize) { break; } } if (html == '') { hasResult = false; suggest_tip = '
    对不起,找不到:' + items + '
    '; } else { hasResult = true; suggest_tip = iframe_attach + '
    ' + items + ',按字母排序
    '; } /***取出当前第一个城市的英文 add at 2011-12-23****/ var pos = html.indexOf("") + 7; //currentSelect = html.substr(pos, html.indexOf("", pos + 1) - pos); currentSelect = html.substr(pos, html.indexOf("", pos) - pos); /*************************************************/ html = suggest_tip + ''; } $results.html(html).show(); $results.children('ul').children('li:first-child').addClass(options.selectClass); $results.children('ul') .children('li') .mouseover(function () { $results.children('ul').children('li').removeClass(options.selectClass); $(this).addClass(options.selectClass); }) .click(function (e) { e.preventDefault(); e.stopPropagation(); selectCurrentResult(); }); } function getCurrentResult() { if (!$results.is(':visible')) return false; var $currentResult = $results.children('ul').children('li.' + options.selectClass); if (!$currentResult.length) $currentResult = false; return $currentResult; } function selectCurrentResult() { $currentResult = getCurrentResult(); if ($currentResult) { $(options.selectCity).val($currentResult.children('a').children("span").eq(1).children('font').html()); $input.val($currentResult.children('a').html().replace(/.+?<\/span>|.+?<\/SPAN>/g, '')).css('color', '#000'); /**绑定ID**/ $('input[name='+$input[0].id+']').val($currentResult.children('a').find('FONT').html()); $('input[name='+$input[0].id+']').change(); /***/ $results.hide(); if ($(options.dataContainer)) { $(options.dataContainer).val($currentResult.attr('rel')); } if (options.onSelect) { options.onSelect.apply($input[0]); } } } function nextResult() { $currentResult = getCurrentResult(); if ($currentResult) $currentResult .removeClass(options.selectClass) .next() .addClass(options.selectClass); else $results.children('ul').children('li:first-child').addClass(options.selectClass); } function prevResult() { $currentResult = getCurrentResult(); if ($currentResult) $currentResult .removeClass(options.selectClass) .prev() .addClass(options.selectClass); else $results.children('ul').children('li:last-child').addClass(options.selectClass); } } $.fn.suggest = function (source, options) { if (!source) return; options = options || {}; options.source = source; options.parentVal = options.parentVal || null; options.listSize = options.listSize || 10; options.hot_list = options.hot_list || []; options.delay = options.delay || 0; options.resultsClass = options.resultsClass || 'ac_results'; options.selectClass = options.selectClass || 'ac_over'; options.matchClass = options.matchClass || 'ac_match'; options.minchars = options.minchars || 1; options.delimiter = options.delimiter || '\n'; options.onSelect = options.onSelect || false; options.dataDelimiter = options.dataDelimiter || '\t'; options.dataContainer = options.dataContainer || '#SuggestResult'; options.attachObject = options.attachObject || null; options.selectCity = options.selectCity || ""; //控件的id,存在选择的city //options.tips = options.tips || "中文/拼音"; this.each(function () { new $.suggest(this, options); }); return this; }; })(jQuery); /* * JTip * By Cody Lindley (http://www.codylindley.com) * Under an Attribution, Share Alike License * JTip is built on top of the very light weight jquery library. */ //on page load (as soon as its ready) call JT_init //$(document).ready(JT_init); function JT_init(){ $("a.jTip") .hover(function(){JT_show(this.href,this.id,this.name)},function(){$('#JT').remove()}) .click(function(){return false}); } function JT_remove(){ $('#JT').remove(); } function JT_show(url,linkId,title){ if(title == false)title=" "; var de = document.documentElement; var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var hasArea = w - getAbsoluteLeft(linkId); var clickElementy = getAbsoluteTop(linkId) - 3; //set y position var queryString = url.replace(/^[^\?]+\??/,''); var params = parseQuery( queryString ); if(params['width'] === undefined){params['width'] = 250;}; if(params['link'] !== undefined){ $('#' + linkId).bind('click',function(){ = params['link'];}); $('#' + linkId).css('cursor','pointer'); } if(hasArea>((params['width']*1)+75)){ $("body").append("
    "+title+"
    ");//right side var arrowOffset = getElementWidth(linkId) + 11; var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position }else{ $("body").append("
    "+title+"
    ");//left side var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position } $('#JT').css({left: clickElementx+"px", top: clickElementy+"px"}); $('#JT').show(); $('#JT_copy').load(url); } function JT_sc_show(url,linkId,title){ if(title == false)title=" "; //var de = document.documentElement; //var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; //var hasArea = w - getAbsoluteLeft(linkId); var clickElementy = getAbsoluteTop(linkId) - 3; //set y position var queryString = url.replace(/^[^\?]+\??/,''); var params = parseQuery( queryString ); if(params['width'] === undefined){params['width'] = 250;}; if(params['link'] !== undefined){ $('#' + linkId).bind('click',function(){ = params['link'];}); $('#' + linkId).css('cursor','pointer'); } /* $("body").append("
    " + "
    " + "
    "+title+"
    " + "
    " + "
    ");//left side*/ var divstr = ""; divstr += "
    "; divstr += "
    "; divstr += "
     
    "; divstr += "
    "; divstr += "
    "; divstr += "
     
    "; divstr += "
    "+title+"
    "; divstr += "
     
    "; divstr += "
    "; divstr += "
    "; divstr += ""; divstr += "
    "; divstr += "
    "; divstr += "
     
    "; divstr += "
    "; divstr += "
    "; divstr += "
    "; divstr += "
    "; divstr += "
    "; divstr += "
    "; divstr += "
     
    "; divstr += "
     
    "; divstr += "
     
    "; divstr += "
    "; divstr += "
    "; $("body").append(divstr); var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position $('#JT').css({left: clickElementx+"px", top: clickElementy+"px"}); $('#JT').show(); $('#JT_copy').load(url); } function JT_solution_show(url,linkId,title){ if(title == false)title=" "; var de = document.documentElement; var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var hasArea = w - getAbsoluteLeft(linkId); var clickElementy = getAbsoluteTop(linkId) - 3; //set y position var queryString = url.replace(/^[^\?]+\??/,''); var params = parseQuery( queryString ); if(params['width'] === undefined){params['width'] = 250}; if(params['link'] !== undefined){ $('#' + linkId).bind('click',function(){ = params['link']}); $('#' + linkId).css('cursor','pointer'); } //if(hasArea>((params['width']*1)+75)){ // $("body").append("
    "+title+"
    ");//right side // var arrowOffset = getElementWidth(linkId) + 11; // var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position //}else{ $("body").append("
    "+title+"
    ");//left side var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position //} $('#JT').css({left: clickElementx+"px", top: clickElementy+"px"}); $('#JT').show(); $('#JT_copy').load(url); } function JT_show_feedetail(url,linkId,title){ if(title == false)title=" "; var de = document.documentElement; var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var hasArea = w - getAbsoluteLeft(linkId); var clickElementy = getAbsoluteTop(linkId) - 3; //set y position var queryString = url.replace(/^[^\?]+\??/,''); var params = parseQuery( queryString ); if(params['width'] === undefined){params['width'] = 250;}; if(params['link'] !== undefined){ $('#' + linkId).bind('click',function(){ = params['link'];}); $('#' + linkId).css('cursor','pointer'); } if(hasArea>((params['width']*1)+75)){ $("body").append("
    ");//right side var arrowOffset = getElementWidth(linkId) + 11; var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position }else{ $("body").append("
    ");//left side var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position } $('#showtips').css({left: clickElementx+"px", top: clickElementy+"px"}); $('#showtips').show(); $('#feedetail_copy').load(url); } function JT_show_green(url,linkId,title){ if(title == false)title=" "; var de = document.documentElement; var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var hasArea = w - getAbsoluteLeft(linkId); var clickElementy = getAbsoluteTop(linkId) - 3; //set y position var queryString = url.replace(/^[^\?]+\??/,''); var params = parseQuery( queryString ); if(params['width'] === undefined){params['width'] = 250}; if(params['link'] !== undefined){ $('#' + linkId).bind('click',function(){ = params['link']}); $('#' + linkId).css('cursor','pointer'); } if(hasArea>((params['width']*1)+75)){ $("body").append("
    "+title+"
    ");//right side var arrowOffset = getElementWidth(linkId) + 11; var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position }else{ $("body").append("
    "+title+"
    ");//left side var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position } $('#JT').css({left: clickElementx+"px", top: clickElementy+"px"}); $('#JT').show(); $('#JT_copy').load(url); } function Tips_show(linkId,title,content,flag){ var clickElementy = getAbsoluteTop(linkId) + 30; if(flag == 'login'){ $("body").append("
    "+title+"
    "+content+"
    "); }else{ $("body").append("
    "+title+"
    "+content+"

                             "+"
    "); } var arrowOffset = getElementWidth(linkId) + 11; var clickElementx = getAbsoluteLeft(linkId) + arrowOffset - 40; $('#showtips').css({left: clickElementx+"px", top: clickElementy+"px"}); $("#showtips").show(); if(flag != 'login'){ $("#showtips").hover(function(){Tips_show(linkId,title,content);},function(){showtips_remove();}); } } function bao_show(linkId,title,content,flag){ var clickElementy = getAbsoluteTop(linkId) + 30; if(flag == 'login'){ $("body").append("
    "+title+"
    "+content+"
    "); }else{ $("body").append("
    "+title+"
    "+content+"

                             "+"
    "); } var arrowOffset = getElementWidth(linkId) + 11; var clickElementx = getAbsoluteLeft(linkId) + arrowOffset - 40; $('#showbao').css({left: clickElementx+"px", top: clickElementy+"px"}); $("#showbao").show(); if(flag != 'login'){ $("#showbao").hover(function(){bao_show(linkId,title,content);},function(){showbao_remove();}); } } function showtips_remove(){ $("#showtips").remove(); } function showbao_remove(){ $("#showbao").remove(); } function getElementWidth(objectId) { x = document.getElementById(objectId); return x.offsetWidth; } function getAbsoluteLeft(objectId) { // Get an object left position from the upper left viewport corner o = document.getElementById(objectId) oLeft = o.offsetLeft // Get left position from the parent object while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element oParent = o.offsetParent // Get parent object reference oLeft += oParent.offsetLeft // Add parent left position o = oParent } return oLeft } function getAbsoluteTop(objectId) { // Get an object top position from the upper left viewport corner o = document.getElementById(objectId) oTop = o.offsetTop // Get top position from the parent object while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element oParent = o.offsetParent // Get parent object reference oTop += oParent.offsetTop // Add parent top position o = oParent } return oTop } function parseQuery ( query ) { var Params = new Object (); if ( ! query ) return Params; // return empty object var Pairs = query.split(/[;&]/); for ( var i = 0; i < Pairs.length; i++ ) { var KeyVal = Pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) continue; var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function blockEvents(evt) { if(evt.target){ evt.preventDefault(); }else{ evt.returnValue = false; } }