½Ç½Ã°£ Àαâ»óÇ°
').text($(ele).text()).css({ position: 'absolute', 'float': 'left', 'white-space': 'nowrap', visibility: 'hidden' }).appendTo($('body')); var temp_width = temp_div.width(); temp_div.remove(); return temp_width; }; App.makeTpl = function() { $('#f2s-ranking').wrap('
'); _ele.append('
'); var css = [], _title_wrap = $('.title-wrap', _ele), _keyword_wrap = $('.keyword-wrap', _ele); $.each(App.xmls['list'], function(i, ele) { $('.keywords', _keyword_wrap).append('
'); }); css.push('.clearfix:before,.clearfix:after { content: " "; display: table; } .clearfix:after { clear: both; } .clearfix { *zoom: 1; }'); css.push('#f2s-ranking, #f2s-ranking *, #f2s-ranking *:before, #f2s-ranking *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }'); css.push('#f2s-ranking { position: relative; margin: 0 auto; width: '+ App.xmls['wid'] +'px; height: '+ (Number(App.xmls['titleHeight'])+Number(App.xmls['hei'])) +'px; }'); css.push('#f2s-ranking .title-wrap { position: relative; z-index: 1; }'); css.push('#f2s-ranking .title-wrap h3 { overflow: hidden; margin: 0; height: '+ App.xmls['titleHeight'] +'px; line-height: '+ App.xmls['titleHeight'] +'px; padding: 0 5px; }'); css.push('#f2s-ranking .keyword-wrap { position: relative; height: '+ App.xmls['hei'] +'px; padding: 5px 0; margin-top: -'+ App.xmls['layerLine_thick'] +'px; overflow: hidden; }'); css.push('#f2s-ranking .keywords { position: relative; list-style: none; padding: 0; margin: 0; }'); css.push('#f2s-ranking .keywords li { position: relative; overflow: hidden; margin: 0 5px 1px 5px; list-style: none; }'); css.push('#f2s-ranking .keywords li a { text-decoration: none; display: block; width: 100%; overflow: hidden; margin: 0 auto; white-space: nowrap; }'); css.push('#f2s-ranking .keywords-num { position: absolute; left: 0; top: 0; }'); css.push('#f2s-ranking .keywords-num em { font-style: normal; }'); // ÄõÅ©¸ðµå ´ëó if (document.compatMode == 'BackCompat') { $('#f2s-ranking').css({ left: '50%', marginLeft: '-'+ ((App.xmls['wid'] / 2) - 10) +'px' }); } // ŸÀÌƲ ¼³Á¤ if (App.xmls['titleType'] == '0') { // ÅؽºÆ® Çü½Ä _title_wrap.html('
'+ App.xmls['titleText'] +'
'); css.push('#f2s-ranking .title-wrap h3 { font-size: '+ App.xmls['titleFontSize'] +'px; color: #'+ App.xmls['titleTextColor'] +'; '+ this.getFont(App.xmls['titleTextType']) +' background-color: #'+ App.xmls['titleBackColor'] +'; }'); if (App.xmls['titleTextBold'] == '1') { css.push('#f2s-ranking .title-wrap h3 { font-weight: bold; }'); } if (App.xmls['titleTextItalic'] == '1') { css.push('#f2s-ranking .title-wrap h3 { font-style: italic; }'); } if (App.xmls['titleTextUnderLine'] == '1') { css.push('#f2s-ranking .title-wrap h3 { text-decoration: underline; }'); } if (App.xmls['titleLine_used'] == '1') { css.push('#f2s-ranking .title-wrap h3 { border: '+ App.xmls['titleLine_size'] +'px solid #'+ App.xmls['titleLine_color'] +'; line-height: '+ (Number(App.xmls['titleHeight']) - (Number(App.xmls['titleLine_size']) * 2)) +'px; }'); } } else if (App.xmls['titleType'] == '1') { // À̹ÌÁö Çü½Ä css.push('#f2s-ranking .title-wrap h3 { text-align: center; margin-bottom: 2px; }'); css.push('#f2s-ranking .title-wrap h3 img { width: auto; height: 100%; }'); _title_wrap.html('
'); } else if (App.xmls['titleType'] == '2') { // ŸÀÌƲ ¾øÀ½ css.push('#f2s-ranking .keyword-wrap { margin-top: 0; }'); css.push('#f2s-ranking { height: '+ Number(App.xmls['hei']) +'px; }'); } // ¼øÀ§ ¹öÆ° ¼³Á¤ var default_rate = 20, number_sizeRate = 'width: 20px; height: 20px; line-height: 20px;'; if (App.xmls['number_sizeRate'] == '0') { // 60% default_rate = default_rate * 0.6; } else if (App.xmls['number_sizeRate'] == '1') { // 80% default_rate = default_rate * 0.8; } else if (App.xmls['number_sizeRate'] == '2') { // 100% default_rate = default_rate * 1; } else if (App.xmls['number_sizeRate'] == '3') { // 120% default_rate = default_rate * 1.2; } else if (App.xmls['number_sizeRate'] == '4') { // 140% default_rate = default_rate * 1.4; } number_sizeRate = 'width: '+ default_rate +'px; height: '+ default_rate +'px; line-height: '+ default_rate +'px;'; css.push('#f2s-ranking .keywords li { }'); css.push('#f2s-ranking .keywords-txt { display: inline-block; padding: '+ (Number(App.xmls['list_gap']) / 2) +'px 0; }'); css.push('#f2s-ranking .keywords li a { '+ this.getFont(App.xmls['textType']) +' font-size: '+ App.xmls['textSize'] +'px; color: #'+ App.xmls['textColor'] +'; text-align: '+ App.xmls['textAlign'] +'; padding-left: '+ (default_rate + 5) +'px; }'); css.push('#f2s-ranking .keywords-num { display: inline-block; top: 50%; margin-top: -'+ (default_rate / 2) +'px; '+ number_sizeRate +' text-align: center; color: #'+ App.xmls['numberText_color'] +'; background-color: #'+ App.xmls['numberBack_color'] +'; font-weight: bold; }'); if (App.xmls['number_type'] == '1') { // ¼ýÀÚ¸¸ css.push('#f2s-ranking .keywords-num { background-color: transparent; border: 0 none; }'); } else if (App.xmls['number_type'] == '2') { // Á¤»ç°¢Çü(¸ð¼¸®Á÷°¢) css.push('#f2s-ranking .keywords-num { }'); } else if (App.xmls['number_type'] == '3') { // Á¤»ç°¢Çü(¸ð¼¸® µÕ±Û°Ô) css.push('#f2s-ranking .keywords-num { -webkit-border-radius: 15%; -moz-border-radius: 15%; border-radius: 15%; }'); } else if (App.xmls['number_type'] == '7') { // µ¿±×¶ó¹Ì css.push('#f2s-ranking .keywords-num { -webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%; }'); css.push('#f2s-ranking .keywords-num em { margin-left: -1px; }'); } if (App.xmls['text_bold'] == '1') { css.push('#f2s-ranking .keywords li .keywords-txt { font-weight: bold; }'); } if (App.xmls['text_italic'] == '1') { css.push('#f2s-ranking .keywords li .keywords-txt { font-style: italic; }'); } if (App.xmls['text_underLine'] == '1') { css.push('#f2s-ranking .keywords li .keywords-txt { text-decoration: underline; }'); } css.push('#f2s-ranking .keywords li a:hover .keywords-txt { color: #'+ App.xmls['rollOver_color'] +'; }'); if (App.xmls['rollOver_underLine'] == '1') { css.push('#f2s-ranking .keywords li a:hover .keywords-txt { text-decoration: underline; }'); } else { css.push('#f2s-ranking .keywords li a:hover .keywords-txt { text-decoration: none; }'); } if (App.xmls['rollOver_bold'] == '1') { css.push('#f2s-ranking .keywords li a:hover .keywords-txt { font-weight: bold; }'); } else { css.push('#f2s-ranking .keywords li a:hover .keywords-txt { font-weight: normal; }'); } insertCss(css.join(' ')); var css = []; // ÃʱâÈ if (App.xmls['layer_used'] == '0') { // °íÁ¤ ÆîħÇü if (App.xmls['layerLine_used'] == '1') { css.push('#f2s-ranking .keyword-wrap { border: '+ App.xmls['layerLine_thick'] +'px solid #'+ App.xmls['layerLine_color'] +'; }'); } // °Ë»ö¾î ¹Ú½º ¼³Á¤ if (App.xmls['layerType'] == '0') { // ¹è°æ»ö ÁöÁ¤ css.push('#f2s-ranking .keyword-wrap { background-color: #'+ App.xmls['layerBack_color'] +'; background-image: none; }'); } else { // À̹ÌÁö css.push('#f2s-ranking .title-wrap { overflow: hidden; }'); css.push('#f2s-ranking .title-wrap h3 { padding: 0; text-align: center; }'); css.push('#f2s-ranking .title-wrap img { width: auto; height: 100%; }'); css.push('#f2s-ranking .keyword-wrap { border: 0 none; background: transparent url('+ App.xmls['layer_url'] +') no-repeat 0 0; }'); } if (Number(App.xmls['textViewNum']) < App.xmls['list'].length) { if (App.xmls['effectMotion'] == '0') { // ÇÑÁÙ¾¿ À§·Î $('#f2s-ranking .keywords').wrap('
'); var line_height = $('#f2s-ranking .keywords li:first').height(); var view_height = (line_height * Number(App.xmls['textViewNum'])) + Number(App.xmls['textViewNum']); css.push('#f2s-ranking .keywords-sub { position: relative; overflow: hidden; top: 50%; margin-top: -'+ (view_height / 2) +'px; }'); css.push('#f2s-ranking .keywords { width: 100%; height: '+ view_height +'px; }'); var rank_ticker_id = null; var rankTicker = function() { rank_ticker_id = setTimeout(function() { $('#f2s-ranking .keywords').animate({ top: '-'+ line_height +'px' }, 250, function() { $('#f2s-ranking .keywords li:first').detach().appendTo('#f2s-ranking .keywords'); $(this).removeAttr('style'); }); rankTicker(); }, App.xmls['effectTime'] * 1000); }; rankTicker(); } else if (App.xmls['effectMotion'] == '1') { // ³ëÃâ °Ë»ö¾î Àüü ¿À¸¥ÂÊ ½½¶óÀ̵å $('#f2s-ranking .keywords').wrap('
'); var line_height = $('#f2s-ranking .keywords li:first').height(); var view_height = (line_height * Number(App.xmls['textViewNum'])) + Number(App.xmls['textViewNum']); var view_width = (Number(App.xmls['wid']) - (Number(App.xmls['layerLine_thick']) * 2)); css.push('#f2s-ranking .keywords-sub { position: relative; width: auto; height: 100%; overflow: hidden; top: 50%; margin-top: -'+ (view_height / 2) +'px; }'); css.push('#f2s-ranking .keywords { position: absolute; top: 0; right: 0; width: '+ view_width +'px; height: '+ view_height +'px; }'); css.push('#f2s-ranking .keywords-hidden { right: -'+ view_width +'px; }'); var _ranks = $('#f2s-ranking .keywords li'), _ranks_div = []; var _cnt = Math.floor(_ranks.size() / App.xmls['textViewNum']); for (var i=0; i<= _cnt; i++) { _ranks_div.push(_ranks.splice(0, App.xmls['textViewNum'])); } $('#f2s-ranking .keywords-sub').empty(); $.each(_ranks_div, function(i) { if (i == 0) { $('#f2s-ranking .keywords-sub').append('
'); } else { $('#f2s-ranking .keywords-sub').append('
'); } $('#f2s-ranking .keywords-sub .keywords:eq('+ i +')').append(this); }); var rank_ticker_id = null, rank_ticker_num = 0; var rankTicker = function() { rank_ticker_id = setTimeout(function() { if (rank_ticker_num >= _cnt) { rank_ticker_num = 0; } else { rank_ticker_num += 1; } if ($('#f2s-ranking .keywords').eq(rank_ticker_num).find('li').size() == 0) {rank_ticker_num = 0; } $('#f2s-ranking .keywords').not('.keywords-hidden').animate({ right: view_width +'px' }, 250, function() { $(this).addClass('keywords-hidden').removeAttr('style'); }); $('#f2s-ranking .keywords').eq(rank_ticker_num).animate({ right: 0 +'px' }, 250, function() { $(this).removeClass('keywords-hidden').removeAttr('style'); }); rankTicker(); }, App.xmls['effectTime'] * 1000); }; rankTicker(); } else { // ÇÑÁÙ¾¿ ¿À¸¥ÂÊ ½½¶óÀ̵å $('#f2s-ranking .keywords').wrap('
'); var line_height = $('#f2s-ranking .keywords li:first').height(); var view_height = (line_height * Number(App.xmls['textViewNum'])) + Number(App.xmls['textViewNum']); var view_width = (Number(App.xmls['wid']) - (Number(App.xmls['layerLine_thick']) * 2)); css.push('#f2s-ranking .keywords-sub { position: relative; width: auto; height: 100%; overflow: hidden; top: 50%; margin-top: -'+ (view_height / 2) +'px; }'); css.push('#f2s-ranking .keywords { position: absolute; top: 0; right: 0; width: '+ view_width +'px; height: '+ view_height +'px; }'); css.push('#f2s-ranking .keywords-hidden { right: -'+ view_width +'px; }'); var _ranks = $('#f2s-ranking .keywords li'), _ranks_div = []; var _cnt = Math.floor(_ranks.size() / App.xmls['textViewNum']); for (var i=0; i<= _cnt; i++) { _ranks_div.push(_ranks.splice(0, App.xmls['textViewNum'])); } $('#f2s-ranking .keywords-sub').empty(); $.each(_ranks_div, function(i) { if (i == 0) { $('#f2s-ranking .keywords-sub').append('
'); } else { $('#f2s-ranking .keywords-sub').append('
'); } $('#f2s-ranking .keywords-sub .keywords:eq('+ i +')').append(this); }); var rank_ticker_id = null, rank_ticker_num = 0; var rankTicker = function() { rank_ticker_id = setTimeout(function() { if (rank_ticker_num >= _cnt) { rank_ticker_num = 0; } else { rank_ticker_num += 1; } if ($('#f2s-ranking .keywords').eq(rank_ticker_num).find('li').size() == 0) {rank_ticker_num = 0; } $('#f2s-ranking .keywords').not('.keywords-hidden').animate({ right: view_width +'px' }, 250, function() { $(this).addClass('keywords-hidden').removeAttr('style'); }); $('#f2s-ranking .keywords').eq(rank_ticker_num).animate({ right: 0 +'px' }, 250, function() { $(this).removeClass('keywords-hidden').removeAttr('style'); }); rankTicker(); }, App.xmls['effectTime'] * 1000); }; rankTicker(); } $('#f2s-ranking .keywords').mouseenter(function() { clearTimeout(rank_ticker_id); }).mouseleave(function() { rankTicker(); }); } else { $('#f2s-ranking .keywords').wrap('
'); var line_height = $('#f2s-ranking .keywords li:first').height(); var view_height = (line_height * Number(App.xmls['textViewNum'])) + Number(App.xmls['textViewNum']); css.push('#f2s-ranking .keywords-sub { position: relative; overflow: hidden; top: 50%; margin-top: -'+ (view_height / 2) +'px; }'); css.push('#f2s-ranking .keywords { width: 100%; height: '+ view_height +'px; }'); } } else { // ¸¶¿ì½º ·Ñ¿À¹ö ÆîħÇü css.push('#f2s-ranking { height: auto; }'); $('#f2s-ranking').parent().height(function() { return $('#f2s-ranking .keyword-wrap').outerHeight(); }); if (App.xmls['titleLine_used'] == '1') { css.push('#f2s-ranking .keyword-wrap { border: '+ App.xmls['titleLine_size'] +'px solid #'+ App.xmls['titleLine_color'] +'; }'); } else { css.push('#f2s-ranking .keyword-wrap { border: 0 none; }'); } if (App.xmls['titleType'] == '1') { // ŸÀÌƲ À̹ÌÁö css.push('#f2s-ranking .keyword-wrap { border: 0 none; background: transparent url('+ App.xmls['title_url'] +'?t='+ new Date().getTime() +') no-repeat 0 0; }'); } else { css.push('#f2s-ranking .keyword-wrap { background-color: #'+ App.xmls['titleBackColor'] +'; }'); } // ¼øÀ§ ³ëÃâ °³¼ö¸¸ Ç¥½Ã $('#f2s-ranking .keywords li:eq('+ (Number(App.xmls['textViewNum']) - 1) +')').nextAll().remove(); if (App.xmls['effectMotion'] == '0') { // ÇÑÁÙ¾¿ À§·Î css.push('#f2s-ranking .title-wrap { display: none; }'); css.push('#f2s-ranking .keyword-wrap { padding: 0; }'); css.push('#f2s-ranking .keywords { margin-top: -'+ App.xmls['layerLine_thick'] +'px; }'); css.push('#f2s-ranking .keywords li { height: '+ App.xmls['hei'] +'px; line-height: '+ App.xmls['hei'] +'px; }'); css.push('#f2s-ranking .keywords li a { line-height: '+ App.xmls['hei'] +'px; }'); var keywords_num_margin = (Number(App.xmls['hei']) - default_rate) / 2; css.push('#f2s-ranking .keywords-num { top: 0; margin-top: '+ keywords_num_margin +'px; line-height: '+ (default_rate + 2) +'px; }'); css.push('#f2s-ranking .keywords-txt { padding: 0; line-height: '+ (Number(App.xmls['hei']) + 2) +'px; }'); var rank_ticker_id = null; var rankTicker = function() { rank_ticker_id = setTimeout(function() { $('#f2s-ranking .keywords li:first').animate({ marginTop: '-'+ App.xmls['hei'] +'px' }, 250, function() { $(this).detach().appendTo('#f2s-ranking .keywords').removeAttr('style'); }); rankTicker(); }, App.xmls['effectTime'] * 1000); }; rankTicker(); } else if (App.xmls['effectMotion'] == '1') { // ³ëÃâ °Ë»ö¾î Àüü ¿À¸¥ÂÊ ½½¶óÀ̵å css.push('#f2s-ranking { height: '+ App.xmls['titleHeight'] +'px; }'); css.push('#f2s-ranking .title-wrap { display: none; }'); css.push('#f2s-ranking .keyword-wrap { padding: 0; background-color: #'+ App.xmls['titleBackColor'] +'; }'); css.push('#f2s-ranking .keywords { width: 1000%; margin-top: -'+ App.xmls['layerLine_thick'] +'px; }'); css.push('#f2s-ranking .keywords li { padding-right: '+ App.xmls['titleLine_size'] +'px; float: left; width: '+ (Number(App.xmls['wid']) - 10) +'px; height: '+ App.xmls['hei'] +'px; line-height: '+ App.xmls['hei'] +'px; }'); css.push('#f2s-ranking .keywords li a { line-height: '+ App.xmls['hei'] +'px; }'); var keywords_num_margin = (Number(App.xmls['hei']) - default_rate) / 2; css.push('#f2s-ranking .keywords-num { top: 0; margin-top: '+ keywords_num_margin +'px; line-height: '+ (default_rate + 2) +'px; }'); css.push('#f2s-ranking .keywords-txt { padding: 0; line-height: '+ (Number(App.xmls['hei']) + 2) +'px; }'); var rank_ticker_id = null; var rankTicker = function() { rank_ticker_id = setTimeout(function() { $('#f2s-ranking .keywords li:first').animate({ marginLeft: '-'+ App.xmls['wid'] +'px' }, 250, function() { $(this).detach().appendTo('#f2s-ranking .keywords').removeAttr('style'); }); rankTicker(); }, App.xmls['effectTime'] * 1000); }; rankTicker(); } else { // ÇÑÁÙ¾¿ ¿À¸¥ÂÊ ½½¶óÀ̵å css.push('#f2s-ranking { height: '+ App.xmls['titleHeight'] +'px; }'); css.push('#f2s-ranking .title-wrap { display: none; }'); css.push('#f2s-ranking .keyword-wrap { padding: 0; background-color: #'+ App.xmls['titleBackColor'] +'; }'); css.push('#f2s-ranking .keywords { width: 1000%; margin-top: -'+ App.xmls['layerLine_thick'] +'px; }'); css.push('#f2s-ranking .keywords li { padding-right: '+ App.xmls['titleLine_size'] +'px; float: left; width: '+ (Number(App.xmls['wid']) - 10) +'px; height: '+ App.xmls['hei'] +'px; line-height: '+ App.xmls['hei'] +'px; }'); css.push('#f2s-ranking .keywords li a { line-height: '+ App.xmls['hei'] +'px; }'); var keywords_num_margin = (Number(App.xmls['hei']) - default_rate) / 2; css.push('#f2s-ranking .keywords-num { top: 0; margin-top: '+ keywords_num_margin +'px; line-height: '+ (default_rate + 2) +'px; }'); css.push('#f2s-ranking .keywords-txt { padding: 0; line-height: '+ (Number(App.xmls['hei']) + 2) +'px; }'); var rank_ticker_id = null; var rankTicker = function() { rank_ticker_id = setTimeout(function() { $('#f2s-ranking .keywords li:first').animate({ marginLeft: '-'+ App.xmls['wid'] +'px' }, 250, function() { $(this).detach().appendTo('#f2s-ranking .keywords').removeAttr('style'); }); rankTicker(); }, App.xmls['effectTime'] * 1000); }; rankTicker(); } // ÄõÅ©¸ðµå if (document.compatMode == 'BackCompat') { css.push('#f2s-ranking .keywords-num { line-height: '+ default_rate +'px; }'); css.push('#f2s-ranking .keywords-num em { vertical-align: -2px; }'); } // °Ë»ö¾î ¹Ú½º ¼³Á¤ if (App.xmls['bgBackType'] == '0') { // ¹è°æ»ö ÁöÁ¤ css.push('#f2s-ranking.active .keyword-wrap { background-color: #'+ App.xmls['layerBack_color'] +'; }'); if (App.xmls['layerLine_used'] == '1') { css.push('#f2s-ranking.active .keyword-wrap { border: '+ App.xmls['layerLine_thick'] +'px solid #'+ App.xmls['layerLine_color'] +'; }'); } } else { // À̹ÌÁö css.push('#f2s-ranking.active .keyword-wrap { background: #'+ App.xmls['layerBack_color'] +' url('+ App.xmls['layer_url'] +') no-repeat 0 0; }'); } css.push('#f2s-ranking.active { z-index: 1001; position: absolute; left: 50%; margin-left: -'+ (Number(App.xmls['wid']) / 2) +'px; height: '+ App.xmls['layer_height'] +'px; }'); css.push('#f2s-ranking.active .keyword-wrap { height: '+ App.xmls['layer_height'] +'px; background-color: #'+ App.xmls['layerBack_color'] +'; }'); css.push('#f2s-ranking.active .keywords { width: auto; margin-top: '+ (Number(App.xmls['line_size']) * 2) +'px; }'); css.push('#f2s-ranking.active .keywords li { float: none; width: auto; height: auto; line-height: normal; }'); css.push('#f2s-ranking.active .keywords li a { line-height: '+ default_rate +'px; }'); css.push('#f2s-ranking.active .keywords-num { top: 50%; margin-top: -'+ (default_rate / 2) +'px; line-height: '+ default_rate +'px; }'); css.push('#f2s-ranking.active .keywords-txt { line-height: normal; padding: '+ (Number(App.xmls['list_gap']) / 2) +'px 0; }'); if (App.xmls['layerLine_used'] == '1') { css.push('#f2s-ranking.active .keyword-wrap { border: '+ App.xmls['layerLine_thick'] +'px solid #'+ App.xmls['layerLine_color'] +'; }'); } else { css.push('#f2s-ranking.active .keyword-wrap { border: 0 none; }'); } if (App.xmls['layerType'] == '0') { // ¹è°æ»ö css.push('#f2s-ranking.active .keyword-wrap { background-image: none; }'); } else { css.push('#f2s-ranking.active .keyword-wrap { background: #'+ App.xmls['layerBack_color'] +' url('+ App.xmls['layer_url'] +') no-repeat 0 0; }'); } var line_height = $('#f2s-ranking .keywords li:first').height(); var view_height = (line_height * Number(App.xmls['textViewNum'])) + Number(App.xmls['textViewNum']); css.push('#f2s-ranking.active .keywords { top: 50%; margin-top: -'+ ((view_height / 2) + (Number(App.xmls['line_size']) * 2)) +'px; }'); $('#f2s-ranking').mouseenter(function() { clearTimeout(rank_ticker_id); if (App.xmls['titleLine_used'] == '1') { $('#f2s-ranking').addClass('active').parent().css({marginTop: '-'+ App.xmls['titleLine_size'] +'px'}); } else { $('#f2s-ranking').addClass('active'); } $('.keywords', this).find('li').sort(function(a, b) { return +$(a).data('num') - +$(b).data('num'); }).appendTo($('.keywords', this)); }).mouseleave(function() { rankTicker(); $('#f2s-ranking').removeClass('active').parent().css({ marginTop: 0 }); }); } insertCss(css.join(' ')); $('#f2s-ranking .keywords li').on('mouseenter', function() { var gap_width = $('.keywords-txt', this).width() + 10; if ($(this).width() < gap_width) { var this_width = $(this).width(); $('.keywords-txt', this).each(function setAni() { $(this).animate({ marginLeft: '-'+ (gap_width - this_width + 15) +'px' }, 1500) .delay(1000).animate({ marginLeft: 0 }, 1500, setAni); }); } }).on('mouseleave', function() { $('.keywords-txt', this).stop(true).css({ marginLeft: 0 }); }); }; }(window.f2sRanking = window.f2sRanking || {})); window.f2sRanking.init();});})(jq183);