var window_width = $(window).width(); var window_height = $(window).height(); var clipboard_js = document.createElement('script'); clipboard_js.src = '/js/clipboard.min.js'; if(clipboard_js.addEventListener) { clipboard_js.addEventListener("load",callback_clipboard_js,false); } else if(clipboard_js.readyState) { clipboard_js.onreadystatechange = callback_clipboard_js; } document.getElementsByTagName('head')[0].appendChild(clipboard_js); function callback_clipboard_js() { } $(document).ready(function(){ /* SNS보내기 URL복사 */ //URL복사 창 가운데 정렬 rePostion = function() { $("#Url_Layer").each(function(){ $(this).css('left', (window_width / 2) - ($(this).width() /2) + 'px'); $(this).css('top', (window_height / 2) - ($(this).height() /2) + 'px'); }); } //URL복사 창 띄우기 showPopup = function() { //$("#Url_Layer").show(); //$("#Url_Layer_bg").show(); //rePostion(); $('img[alt=URL복사]').parent().attr("id","urlcopy"); $('img[alt=URL복사]').attr("data-clipboard-text",$("#Url_Layer .ct_bg textarea").val()); var clipboard = new ClipboardJS('#urlcopy img'); var isMobile = false; var filter = "win16|win32|win64|mac"; if (navigator.platform) { isMobile = filter.indexOf(navigator.platform.toLowerCase()) < 0; } clipboard.on('success', function(e) { if(!isMobile) { alert("복사되었습니다."); } }); } //URL복사 창 브라우저 사이즈에 따라 위치 재설정 $(window).bind("resize", function(){ rePostion(); }); //닫기버튼 클릭시 닫기 $("#Url_Layer .close").bind("click", function(){ $("#Url_Layer").css('display','none'); $("#Url_Layer_bg").css('display','none'); }); //URL주소 클릭시 자동 전체석택 $("#Url_Layer .ct_bg textarea").click( function () { $(".ct_bg textarea").select(); }); //URL복사 창 뒤에 배경 클릭시 닫기 $("#Url_Layer_bg").bind("click", function(){ $("#Url_Layer").css('display','none'); $("#Url_Layer_bg").css('display','none'); }); /* //SNS보내기 URL복사 */ /* tss 추가 */ audio = new Audio(); tts_chk = false; $('#tts_on').click(function() { if (!$(this).data("clickStatus")) { $(this).data("clickStatus", 1); var a= $(this).attr('tts_url'); var b= $(this).attr('tts_uid'); var s=document.getElementById("tts_on"); var tts_data="tts_url="+a+"&tts_uid="+b; if(!tts_chk) { $.ajax({ data: tts_data, type: 'GET', cache: false, async: false, url: 'https://tts.inswave.net/tts_ins.php', success:function(args){ tts_chk = true; audio.src = args; audio.load(); audio.play(); $("#tts_on").attr("speak","off"); }, error:function(request,status,error){ alert(request.status+":"+request.responseText+"::"+error); } }); } else { audio.play(); $("#tts_on").attr("speak","off"); } } else { $(this).data("clickStatus", 0); audio.pause(); audio.currentTime = 0; $("#tts_on").attr("speak","on"); } }); /* tts 끝 */ /* tss2 추가 */ audio2 = new Audio(); tts_chk2 = false; $('#tts2_on').click(function() { var a= $(this).attr('tts_url'); var b= $(this).attr('tts_uid'); var s=document.getElementById("tts2_on"); var tts_data="tts_url="+a+"&tts_uid="+b; if(!tts_chk2) { $.ajax({ data: tts_data, type: 'GET', cache: false, url: 'https://tts2.inswave.net/tts_ins_ms.php', success:function(args){ tts_chk2 = true; audio2.src = args; audio2.load(); audio2.play(); $("#tts2_on").attr("class","speak_on"); }, error:function(request,status,error){ alert(request.status+":"+request.responseText+"::"+error); } }); } else { audio2.pause(); $("#tts2_on").attr("class","speak"); } }); /* tts 끝 */ /* 좋아요 */ $(document).on("click",".btn_like",function(){ var uid = $(this).attr("data-uid"); var domain = $(this).attr("data-domain"); var title = $('.read_title').text(); var fdata = "d_mode=input&uid="+uid+"&domain="+domain+"&title="+title; $(this).attr('class','btn_like_on'); $.ajax({ type: "GET", url: "https://tts2.inswave.net/php_bin/ins_wave_like_el.php", data: fdata, cache: false, async: false, success: function(data){ if(data) { $('.like_cnt').html(data); } else { } } }); }); /* 좋아요끝 */ //ssl 적용시 이미지 주소들이 http:// 인 경우 해당 이미지 주소가 강제 https:// 접속으로 인하여 ssl 적용 안된 곳은 접속 오류로 노출 안되는 문제 적용 /*var protocol = location.protocol; if(protocol=="https:") { $("img").each(function() { var imgsrc = $(this).attr("src"); if(imgsrc.indexOf("http:") != -1) { $(this).attr("src","https://f.xza.co.kr/"+imgsrc); } }); $("span.img").each(function() { var bg_url = $(this).css('background-image'); bg_url = /^url\((['"]?)(.*)\1\)$/.exec(bg_url); bg_url = bg_url ? bg_url[2] : ""; $(this).css({"background":"url(https://f.xza.co.kr/"+ bg_url +")"}); }); }*/ }); var ajax = { request : '', ajax_init : function(){ try { ajax.request = new XMLHttpRequest(); } catch (trymicrosoft) { try { ajax.request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (othermicrosoft) { try { ajax.request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { ajax.request = false; } } } if (!ajax.request) { alert("Error initializing XMLHttpRequest!"); } }, ajax_action: function (url,method,parameters,onok,onfail) { ajax.ajax_init(); if(method=="get") { ajax.request.open("GET",url, true); ajax.request.onreadystatechange =onok; ajax.request.send(null); } else if(method=="post") { ajax.request.open('POST',url, true); ajax.request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax.request.setRequestHeader("Content-length",parameters.length); ajax.request.setRequestHeader("Connection", "close"); ajax.request.send(parameters); ajax.request.onreadystatechange = onok; } }, script_add : function () { var url = "./j1_exe.php?uid="; ajax.ajax_action(url,'get','',rPage,''); }, ins_main_create : function () { // alert('aa'); var url = "./ins_main_create.php"; ajax.ajax_action(url,'get','',rPage,''); } }; function rPage() { if (ajax.request.readyState == 4) { if (ajax.request.status == 200) { //result = ajax.request.responseText; //alert(result); } else { //alert('입력 에러'); } } } function img_resize() { // content 아이디 내의 모든 이미지 크기가 maxsize 보다 크면 maxsize로 리사이즈. maxsize = document.body.clientWidth; //창크기 //var content = document.getElementById("content"); // eval('content.width = maxsize/1.2') ; var img = document.getElementsByTagName("img"); var table = document.getElementsByTagName("table"); for(i=0; i maxsize') ) { eval('img[' + i + '].width = maxsize/1.2') ; } } } //window.onload = img_resize; //window.onresize = img_resize; //카카오톡 보내기 function executeURLLink(a,b,c,d) { kakao_send_mobile.link("talk").send({ msg : a, url : b, appid : c, appver : "2.0", appname : d, type : "link" }); } //카카오스토리 보내기 function executeKakaoStoryLink(a,b,c,d,e,f,g) { kakao_send_mobile.link("story").send({ post : b, appid : c, appver : "1.0", appname : d, urlinfo : JSON.stringify({title:a, desc:e, imageurl:[f], type:g}) }); } function log_count(url) { ajax.ajax_action(url,'get','',null_ok,''); } function m_count(url) { ajax.ajax_action(url,'get','',null_ok,''); //ajax.ajax_action(url,'post','',null_ok,''); return false; } function null_ok() { } function reader_checkForm_body(){ formObj = document.rc; if (formObj.reader_name.value == '') { alert('이름을 입력해 주십시오 '); formObj.reader_name.focus(); return false; } else if(formObj.reader_passwd.value == '') { alert(' 패스워드를 입력해 주십시오'); formObj.reader_passwd.focus(); return false; } else if(formObj.reader_body.value == '') { alert(' 내용을 입력해 주십시오'); formObj.reader_body.focus(); return false; } else if(formObj.nospam.value == '') { alert(' 스팸검사에 옆의 숫자를 입력해 주십시오'); formObj.nospam.focus(); return false; } var url=$rss_url +"/m/php_bin/ins_reader_add_exe.php"; var parameters="d_mode=input&newsuid="+formObj.newsuid.value; parameters +="&reader_name="+ encodeURI(formObj.reader_name.value); parameters +="&reader_passwd="+ encodeURI(formObj.reader_passwd.value); parameters +="&reader_body="+ encodeURI(formObj.reader_body.value); parameters +="&nospam="+ encodeURI(formObj.nospam.value); parameters +="&u_id="+ encodeURI(formObj.d_id.value); //alert(parameters); ajax.ajax_action(url,'post',parameters,r_c,''); formObj.reader_name.value=""; formObj.reader_passwd.value=""; formObj.reader_body.value=""; formObj.nospam.value=""; return false; } function vod_main_view(v_uid) { var url2="/php_bin/ins_news_vod_main_view.php?d_mode=get&v_uid="+v_uid; ajax.ajax_action(url2,'get','',vod_ok,''); } function vod_ok() { if (ajax.request.readyState == 4) { if (ajax.request.status == 200) { result = ajax.request.responseText; document.getElementById('ins_vod_main').innerHTML = result; } else { alert('입력 에러'); } } } $(document).ready(function () { /* 검색 버튼 : 시작 */ $("#category").appendTo("#cWrap"); $("#c_header .category").click(function () { $("#category").removeClass("none"); $("#cWrap").attr("class") != "showCate" && $("#cWrap").addClass("hideCate"); $("#c_header").hasClass("search") && $("#c_header .search").trigger("click"); $("#c_header").toggleClass("cate"); $("#cWrap").hasClass("showCate") ? $("#cWrap").removeClass("showCate").addClass("hideCate").animate({ display: "block" }, 600, function () { $(this).removeClass("hideCate") }) : $("#cWrap").removeClass("hideCate").addClass("showCate"); $("#searchBox").hasClass("show") && $("#searchForm").toggle() }); $("#c_header .search").click(function () { $("#searchBox").hasClass("show") || ($(this).toggleClass("on"), $("#c_header").hasClass("cate") && $("#c_header .category").trigger("click"), $("#c_header").toggleClass("search"), $("#searchBox").toggle(), 0 == $("#dimmed_content").size() && $('
').prependTo("#content").hide().click(function () { $("#c_header .search").trigger("click") }), $("#dimmed_content").height($("#content").height() + $("#footer").outerHeight() - $("#navi .gnb_title").outerHeight()).css("marginTop", $("#navi .gnb_title").outerHeight()).toggle(), $("#q").focus()) }); $("#mLocalMove").removeAttr("href").click(function () { goChooseCate($.cookie("mLocal").split(",")) }); location.href.indexOf("search.pang") > -1; $("#q").bind("keyup", function () { if($(this).val() != "") { $("#q_del").css("display", "block") } else { $("#q_del").css("display", "none") } }).focus(function () { $(this).trigger("keyup") }); $("#q_del").click(function () { $("#q").val("").focus() }); $("#searchForm").bind("submit", function () { if("" != $("#q").val()) { return !0 } alert("검색어를 입력해주세요."); return !1 }); $(".category h4 a").click(function () { $(this).hasClass("useSub") && $(this).toggleClass("on").parent().next().slideToggle(300) }); $("#blockLay").click(function () { $("#c_header .category").trigger("click") }); $("#selDetailLoc").click(function () { if("block" == $("#category_loc").css("display")) { var b = []; $("#category_loc input:checked").each(function () { b.push($(this).val()) }); goChooseCate(b) } locCate() }); $("input[type=tel].useValid").bind({ keyup: function () { 0 == num_regx.test($(this).val()) && alert("숫자만 넣어주세요"), $(this).focus() }, focus: function () { $(this).val($(this).val().replace(/-/gi, "")) }, blur: function () { $(this).val($(this).val().replace(/(^02.{0}|^01.{1}|[0-9]{3})([0-9]+)([0-9]{4})/, "$1-$2-$3")) } }); $("input[type=email].useValid").bind({ blur: function () { 0 == email_regx.test($(this).val()) && alert("정보를 정확히 입력해주시기 바랍니다."), $(this).focus() } }) /* 검색 버튼 : 끝 */ /* 글자 사이즈 조절 : 시작 */ $('.fontsize .bt').click( function(){ var $contents = $('#textinput'); var fontSize = $contents.css('font-Size'); var num = parseFloat(fontSize, 10); var unit = fontSize.slice(-2); var th = $(this); var o = 0; $contents.find('span, td').each(function(i, e){ if($(this).css('font-Size')) { var fontSize2 = $(this).css('font-Size'); var num2 = parseFloat(fontSize2, 10); var unit2 = fontSize2.slice(-2); if(num2 > 0) { if(th.attr("id") == "fontBig") { num2 *= 1.5; } else if(th.attr("id") == "fontSmall") { num2 /= 1.5; } var tmp = $(this).attr("style"); var RegExpCSS = /(font-size:( )?[0-9]{0,4}(.)?[0-9]{0,10}?(px|pt|%)( )?!important;)/ig; if( typeof tmp != "undefined"){ tmp = tmp.replace(RegExpCSS, '')+" "; } else { tmp = ""; } $(this).css("cssText", "font-Size: " + num2 + unit2 + " !important;"); $(this).attr("style",tmp+$(this).attr("style")); tmp = ""; } } }); if(this.id == "fontBig") { num *= 1.5; } else if(this.id == "fontSmall") { num /= 1.5; } $contents.css("cssText", "font-Size: " + num + unit + " !important;"); }); /* 글자 사이즈 조절 : 끝 */ setTimeout(function() { if(window.pageYOffset == 0) { window.scrollTo(0, 1); }}, 100); // 주소창 감추기 }); var font_size=17; function fontsizeasc() { font_size=font_size+4; var f = document.getElementById( 'textinput' ); f.style.fontSize=font_size+"px"; } function fontsizedesc() { font_size=font_size-4; var f = document.getElementById( 'textinput' ); f.style.fontSize=font_size+"px"; } function searchArticle(){ var sform = document.search; sform.action ="/b.html"; sform.submit(); } function close_click(id){ var objDiv = document.getElementById(id); if(objDiv.style.display=="block"){ objDiv.style.display = "none"; } else { objDiv.style.display = "block"; } } function toggleLayer(whichLayer) { var elem, vis; if(document.getElementById) // this is the way the standards work elem = document.getElementById(whichLayer); else if(document.all) // this is the way old msie versions work elem = document.all[whichLayer]; else if(document.layers) // this is the way nn4 works elem = document.layers[whichLayer]; vis = elem.style; // if the style.display value is blank we try to figure it out here if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none'; vis.display = (vis.display==''||vis.display=='block')?'none':'block'; } //무단복사 방지 마우스 드래드 금지 function mou() { // } document.contextmenu = new Function ('return false'); function stylewidth(url) { var tag = ""; if(url) { var regExp = /width:( )?([0-9]{0,4})(%|px)?/; var matchs = url.match(regExp); if (matchs) { tag += matchs[2]; } return tag; } } function stylewidth2(url) { var tag = ""; if(url) { var regExp = /([0-9]{0,4})(%|px)?/; var matchs = String(url).match(regExp); if (matchs) { tag += matchs[1]; } return tag; } } function tree_ad(line, style, up_down) { line = typeof line !== 'undefined' ? line : 1; style = typeof style !== 'undefined' ? style : 'float:right; width:200px; height:200px; padding: 0 0 0 10px; position: relative; z-index:999999999;'; up_down = typeof up_down !== 'undefined' ? up_down : 'up'; var p_i = 0; var div_i = 0; var br_i = 0; var chk = 0; //console.log("1_"+line+'_'+chk); $("#textinput").find('p').each(function(){ if($.trim(this.innerHTML) !== " " && this.innerHTML !== " " && $(this).attr('class') !== 'body_img_caption' && $(this).find('img').attr('id') !== 'img_pop_view') { p_i++; if(p_i==line) { var index = $('#textinput p').index(this); if(up_down=='up') { $("#textinput p:eq("+index+")").before("
"); } else { $("#textinput p:eq("+index+")").after("
"); } window['tree_line_'+line] = $("#tree_line_"+line); window['tree_line_tmp_'+line] = $("#tree_line_tmp_"+line); window['tree_line_tmp_'+line].css('display','block'); window['tree_line_'+line].append(window['tree_line_tmp_'+line]); chk = 1; //console.log("2_"+line+'_'+chk); return false; } } }); if(chk==0) { //console.log("3_"+line+'_'+chk); $("#textinput").find('br').each(function(){ if($.trim(this.innerHTML) !== " " && this.innerHTML !== " " && $(this).attr('class') !== 'body_img_caption') { br_i++; if(br_i==line) { var index = $('#textinput br').index(this); if(up_down=='up') { $("#textinput br:eq("+index+")").before("
"); } else { $("#textinput br:eq("+index+")").after("
"); } window['tree_line_'+line] = $("#tree_line_"+line); window['tree_line_tmp_'+line] = $("#tree_line_tmp_"+line); window['tree_line_tmp_'+line].css('display','block'); window['tree_line_'+line].append(window['tree_line_tmp_'+line]); chk = 1; //console.log("4_"+line+'_'+chk); return false; } } }); if(chk==0) { $("#textinput").find('div').each(function(){ if($(this).attr('id')) { if($.trim(this.innerHTML) !== " " && $.trim(this.innerHTML) !== "" && $(this).attr('class') !== 'thumb_box' && $(this).attr('class') !== 'body_img_table2' && $(this).attr('id').indexOf('tree_line_') !== -1 && $(this).attr('id').indexOf('mov') !== -1 && $(this).attr('id').indexOf('tree_line_tmp_') !== -1) { div_i++; if(div_i==line) { var index2 = $('#textinput div').index(this); if(up_down=='up') { $("#textinput div:eq("+index2+")").before("
"); } else { $("#textinput div:eq("+index2+")").after("
"); } window['tree_line_'+line] = $("#tree_line_"+line); window['tree_line_tmp_'+line] = $("#tree_line_tmp_"+line); window['tree_line_tmp_'+line].css('display','block'); window['tree_line_'+line].append(window['tree_line_tmp_'+line]); chk = 1; //console.log("5_"+line+'_'+chk); return false; } } } else { if($.trim(this.innerHTML) !== " " && $.trim(this.innerHTML) !== "" && $(this).attr('class') !== 'thumb_box' && $(this).attr('class') !== 'body_img_table2') { div_i++; if(div_i==line) { var index2 = $('#textinput div').index(this); if(up_down=='up') { $("#textinput div:eq("+index2+")").before("
"); } else { $("#textinput div:eq("+index2+")").after("
"); } window['tree_line_'+line] = $("#tree_line_"+line); window['tree_line_tmp_'+line] = $("#tree_line_tmp_"+line); window['tree_line_tmp_'+line].css('display','block'); window['tree_line_'+line].append(window['tree_line_tmp_'+line]); chk = 1; //console.log("6_"+line+'_'+chk); return false; } } } }); } } } //본문이미지 가운데 정렬 작은 이미지일 경우 원본 사이즈 $(document).ready(function(){ /* 이미지 크키가 큰데 좌우측 정렬이면 작게나오는 현상 적용 */ $("#textinput").find('.body_img_left,.body_img_right').each(function (i) { var _this = $(this); _this.find('img').each(function(){ var old_w = $(this).get(0).naturalWidth; //console.log("1_1: "+old_w); if(old_w!=0 && old_w<=300) { _this.width(old_w); //$(this).width(old_w); //console.log("1: "+_this.attr("width")); } else { _this.width("100%"); _this.css("width","100% !important"); //console.log("2: "+_this.attr("width")); } }); }); /* //이미지 크키가 큰데 좌우측 정렬이면 작게나오는 현상 적용 */ $("#textinput").find('.body_img_center').find('img').each(function (i) { var old_w = $(this).get(0).naturalWidth; //console.log("1_1: "+old_w); if(old_w!=0 && old_w<=300) { $(this).width(old_w); //$(this).width(old_w); //console.log("1: "+$(this).attr("width")); } }); $('#textinput').find('table').each(function(){ var _this = $(this); if($(this).attr("style")) { if($(this).attr("style").match("width: 100%")) { $(this).find('img').each(function(){ if($(this).attr("src")=="/img/icon_view.png?w=170628" || $(this).attr("src")=="/img/close_btn.gif") { } else { $(this).load(function(){ var old_w = $(this).get(0).naturalWidth; //console.log("2_2: "+old_w); if(old_w!=0 && old_w<=300) { _this.attr("style",old_w); //console.log("1: "+$(this).attr("width")+' /// '+old_w); } }).each(function(){ if(this.complete){ $(this).trigger("load"); //console.log("2: "+$(this).attr("width")); } }); } }); } else { if(stylewidth($(this).attr("style"))>320) { $(this).attr('style',$(this).attr("style").replace(/(width:( )?.[0-9]{0,4}(%|px)?)/gi, 'width: 100% !important')); $(this).css("width","100% !important"); //console.log("2: "+$(this).attr("width")); } } } if($(this).attr("width")) { if($(this).attr("width").match("100%")) { //console.log("3: "+$(this).attr("width")); $(this).find('img').each(function(){ if($(this).attr("src")=="/img/icon_view.png?w=170628" || $(this).attr("src")=="/img/close_btn.gif") { } else { $(this).load(function(){ var old_w = $(this).get(0).naturalWidth; //console.log("2_2: "+old_w+' // '+$(this).attr("src")); if(old_w!=0 && old_w<=300) { _this.attr("width",old_w); //console.log("1: "+$(this).attr("width")+' /// '+old_w); } }).each(function(){ if(this.complete){ $(this).trigger("load"); //console.log("2: "+$(this).attr("width")); } }); } }); } else { //console.log("4: "+"a_1_"+stylewidth2($(this).attr("width"))); if(stylewidth2($(this).attr("width"))>320) { //console.log("5: "+"a_"+$(this).attr("width")); $(this).attr('width',"100%"); $(this).css("width","100% !important"); } } } }); $('#textinput').find('img').each(function(){ //console.log("6: "+$(this).attr("width")); if(Number(stylewidth2($(this).attr("width")))>320) { //console.log("7: "+"a_2_"+$(this).attr("width")); $(this).removeAttr("width"); $(this).attr('width',"100%"); //var w_t = 100+"%"; //$(this).attr("width", w_t ); $(this).css("width","100% !important"); //console.log($(this).attr("src")) //console.log("8: "+"a_22_"+$(this).attr("width")+" : "+w_t); } //console.log($(this).attr("src")); $(this).load(function(){ var old_w = $(this).get(0).naturalWidth; //console.log("2_2: "+old_w); if(old_w!=0 && old_w<=300) { $(this).width(old_w); //console.log("1: "+$(this).attr("width")+' /// '+old_w); } }).each(function(){ if(this.complete){ $(this).trigger("load"); //console.log("2: "+$(this).attr("width")); } }); /*_this.on("load",function(){ var old_w = $(this).get(0).naturalWidth; //console.log("2_2: "+old_w); if(old_w!=0 && old_w<=300) { $(this).width(old_w); //$(this).width(old_w); //console.log("1: "+$(this).attr("width")); } }).each(function(){ if(this.complete){ $(this).trigger("load"); } });*/ }); }); if(typeof jQuery != 'undefined') { $(document).ready(function(){ $(document).on('click', "#textinput .img_zoom", function(event) { event.preventDefault(); var img_name = $(this).attr('href'); var img_o=''; var h = ''; var w = ''; $('#textinput').find('img').each(function(){ img_o = $(this).attr("src"); if(img_o && img_name==img_o){ h = $(this).height(); w = $(this).width(); return false; } }) $.blockUI( { message: ' ', fadeIn: 700, fadeOut: 700, //onOverlayClick: $.unblockUI, //blockMsgClass: 'PhotoAdd', css: { position: 'absolute', top: ($(window).height())/2+($(document).scrollTop()-80) + 'px', left: ($(window).width()-w) /2 + 'px', width: w+'px' } }); //setTimeout($.unblockUI, 50000); }); }); } function img_pop_close() { $.unblockUI(); //setTimeout($.unblockUI, 1000); }; /*center 함수 재정의*/ jQuery.fn.center = function () { this.css('top', Math.max(0,(($(window).height()-$(this).outerHeight())/2) + $(window).scrollTop())+'px'); this.css('left', Math.max(0,(($(window).width()-$(this).outerWidth())/2) + $(window).scrollLeft())+'px'); console.log($(this).outerHeight()); return this; }