评论(0)
9年前说

微信 HTTP_USER_AGENT

在iPhone下,返回

Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B176 MicroMessenger/4.3.2

在Android下,返回

Mozilla/5.0 (Linux; U; Android 2.3.6; zh-cn; GT-S5660 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 MicroMessenger/4.5.255
评论(0)
9年前说
  1. //autoHeight
  2. var autoHeight = function(mySelect){
  3.     mySelect.css({"min-height""inherit"});
  4.     var textHeight = mySelect.map(function() {
  5.         return $(this).outerHeight();
  6.     }).get();
  7.     var maxHeight = Math.max.apply(null, textHeight);
  8.     mySelect.css({"min-height": maxHeight});
  9. }
  10. autoHeight($('.ministries-selector li,.free-links ul li'));
  11. $(window).resize(function() {
  12.     autoHeight($('.ministries-selector li,.free-links ul li'));
  13. });
  14. //about scroll
  15. var animateGoto = function(postion,callback){
  16.     $("body,html").animate({"scrollTop":postion},800,callback || function(){});
  17. }
  18. $(".about .widget li").each(function() {
  19.     var myClick = $('a', $(this)),
  20.         This = $(this).index();
  21.     myClick.click(function () {
  22.         jumpTo = $("body").find("h2.title").eq(This);
  23.         animateGoto(jumpTo.position().top - 20);
  24.         return false;
  25.     });
  26. });
  27. //
  28. $(".faq_r ul li .question").click(function() {
  29.     if ( $(this).parent("li").hasClass('open')) {
  30.         $(this).parent("li").find('.answer').slideUp();
  31.         $(".faq_r ul li").removeClass('open');
  32.     }else{
  33.         $(".faq_r ul li .answer").slideUp();
  34.         $(this).parent("li").find('.answer').slideDown();
  35.         $(".faq_r ul li").removeClass('open');
  36.         $(this).parent("li").addClass('open');
  37.     };
  38. });
  39. //bxslider
  40. $('.slider ul').bxSlider({
  41.     minSlides: 2,
  42.     maxSlides: 3,
  43.     slideWidth: 170,
  44.     slideMargin: 10,
  45.     auto: true,
  46.     moveSlides: 1,
  47.     autoControls: false
  48. });
  49. //placeholder
  50. $('input.placeholder, textarea.placeholder').each(function() {
  51.     var $this = $(this),
  52.         $label = $this.siblings('label.placeholder');
  53.     if ($label.length < 1) {
  54.         $label = $('<label/>').attr('class', 'placeholder');
  55.         $label.text($(this).attr('placeholder')).insertBefore($this);
  56.     }
  57.     $this.prop('placeholder', '').bind('focus', function() {
  58.         //$label.hide();
  59.     }).bind('blur change updateState input propertychange', function() {
  60.         if ($this.val() == '') {
  61.             $label.show();
  62.         } else {
  63.             $label.hide();
  64.         }
  65.     }).trigger('updateState');
  66.     $label.bind('click', function() {
  67.         $this.trigger('focus');
  68.     });
  69. });
  70. //select
  71. $(".select").each(function() {
  72.     var selects = "",
  73.         selected = "";
  74.     $(this).find("select option").each(function() {
  75.         selects += "<li>" + $(this).html() + "</li>";
  76.     });
  77.     selected = $(this).find("select option:selected").html();
  78.     //select mandatory
  79.     $(this).find("select option:first").val(''); //z
  80.     if ($(this).find("select").size() > 0) {
  81.         $(this).append('<div class="selected current">' + selected + '</div><ul>' + selects + '</ul>');
  82.         $(this).find("li:eq(0)").addClass("hover");
  83.         //cf7
  84.         //$(this).find("option:eq(0)").val("");
  85.     }
  86.     $(this).find("li").removeClass("hover")
  87.     $(this).find("li:eq(" + $(this).find("select option:selected").index() + ")").addClass("hover");
  88. });
  89. $(".select .selected").on("click"function(e) {
  90.     $(".select").parent().css("z-index", 0);
  91.     $(this).parent().parent().css("z-index", 100);
  92.     $(".select .selected").removeClass("ss");
  93.     if ($(this).parent().find("ul").css("display") == "block") {
  94.         $(this).removeClass("ss");
  95.         $(this).parent().find("ul").fadeOut();
  96.     } else {
  97.         $(this).addClass("ss");
  98.         $(".select ul").hide();
  99.         $(this).parent().find("ul").fadeIn();
  100.     }
  101. });
  102. $(".select li").on("click"function() {
  103.     $(this).parent().parent().find(".select option").removeAttr("selected");
  104.     $(this).parent().parent().find(".nselect option:eq(" + $(this).index() + ")").attr("selected""selected");
  105.     if ($(this).parent().parent().find(".nselect option:eq(" + $(this).index() + ")").val() != "") {
  106.         $(this).parent().parent().find(".selected").removeClass("current");
  107.     } else {
  108.         $(this).parent().parent().find(".selected").addClass("current");
  109.     }
  110.     $(this).addClass("hover").siblings(".select li").removeClass("hover");
  111.     $(this).parent().parent().find(".selected").html($(this).html());
  112.     $(this).parent().hide();
  113.     $(this).parent().parent().find(".selected").removeClass("ss");
  114. })
  115. $(".select").click(function(e) {
  116.     e.stopPropagation();
  117. });
  118. $(document).click(function() {
  119.     $(".select ul").hide();
  120.     $(".selected").removeClass("ss");
  121. });
  122. //tabs
  123. $(".tabs .titles li").each(function() {
  124.     var This = $(this).index();
  125.     $(this).click(function () {
  126.         $(".tabs .titles li,.contents > ul > li").removeClass('current');
  127.         tabTo = $(".tabs").find(".contents > ul > li").eq(This);
  128.         $(this).addClass('current');
  129.         tabTo.addClass('current');
  130.         if ($(this).hasClass('location')) {
  131.             $(".map iframe").attr('src' , $(".map iframe").attr('src'));
  132.         };
  133.     });
  134. });
  135. //fixed menu hover bug
  136. $(".menu li").each(function(){
  137.     $(this).css({
  138.         width: $(this).outerWidth(),
  139.         "padding-right" : "0"
  140.     });
  141. })
  142. //wordpress jquery
  143. var $ = jQuery.noConflict();
  144. //click
  145. $("html").on('click', function(event) {
  146.   var $target = $(event.target);
  147.   if (!$target.parents().addBack().is("selector")){
  148.     //do something
  149.   };
  150. });
  151. //svgConvert
  152. $('img.svg').each(function(){
  153.     var $img = jQuery(this);
  154.     var imgID = $img.attr('id');
  155.     var imgClass = $img.attr('class');
  156.     var imgURL = $img.attr('src');
  157.     $.get(imgURL, function(data) {
  158.         // Get the SVG tag, ignore the rest
  159.         var $svg = $(data).find('svg');
  160.         // Add replaced image's ID to the new SVG
  161.         if(typeof imgID !== 'undefined') {
  162.             $svg = $svg.attr('id', imgID);
  163.         }
  164.         // Add replaced image's classes to the new SVG
  165.         if(typeof imgClass !== 'undefined') {
  166.             $svg = $svg.attr('class', imgClass+' replaced-svg');
  167.         }
  168.         // Remove any invalid XML tags as per http://validator.w3.org
  169.         $svg = $svg.removeAttr('xmlns:a');
  170.         // Replace image with new SVG
  171.         $img.replaceWith($svg);
  172.     }, 'xml');
  173. });
  174. //scroll
  175. if ( $(window).scrollTop() > $('.menu').position().top ) {
  176.     $('.menu').addClass('fixed');
  177. else {
  178.     $('.menu').removeClass('fixed');
  179. }
评论(0)
9年前说

I am back

评论(1)
10年前说

人家在秀ios8 我却在安装MIUI V6 捉急

像手机刷机,电脑装系统之类的折腾活一直是我的“爱好”,大学时代我都可以一个晚上连续重装XP达4次,把Nokia N78 Symbia系统刷个几遍,还自己搞了一个N78的优化固件包。

毕业后,由于工作之类的事,需要用电脑办公,所以基本不折腾了,手机也没怎么搞了,毕竟很少玩,用实习工资买的小米2S,有MIUI每周自动更新,也少了很多事。一转眼都半年多没重装手机系统了,发现android用久了还是慢了N多,关注的MIUI V6终于在昨天下午放出类特别版,正好没啥事,那就开撸吧。

刷机没啥难度,几分钟遍搞定。后面便是安装程序 更换字体之类的操作。但是在安装chrome 和hangouts的时候,需要google play,找了google框架套件之后安装,发现居然不能用,秒退。看看论坛 发现不少人有这个反馈。然后我就手动卸载安装的google套件,在小米应用商店下载google应用安装器,根据步骤搞下来,好像搞定了,但是重启之后,google play还是闪退,但是chrome 和hangouts已经可以用了,那就将就这吧,反正目的不是要google play。(后面发现升级不了chrome hangouts)。

更换字体什么的无非就是替换系统的几个字体文件,比较烦的是,获取root权限的时候,居然弹出了5次确认提示,每次还得等5s才能点击,想快的不行啊,看的我都着急,看来小米对root还是比较慎重的。

接着就卸载自带的软件 百度输入法 米聊 XXX之类的,当然部分需要root。

最后有个蛋疼的需求,就是想装B 切换到了英文字体,但是切换之后,来电显示的归属地都变成了China了,这个问题在我第一次用小米就出现了。依旧回小米论坛找方法,但是几年前用户提的需求,都被小米否决了,说英文版是用回android自带的来显归属地,只能显示china,如果要加入拼音的归属地的话,占用资源太多,而且英文用户对这个没多大需求,尽管挺多人反馈这个问题,几年后依旧~

还是万能的搜索引擎,找到了一个方法,这里分享下。目测android通用

(以下须root操作,修改前请备份 新手须谨慎)

下载文件 86_en (中国号码归属地)

找到system/framework/ext.jar,下载回电脑,用好压之类的解压工具打开(不是解压),把这个文件覆盖到ext.jar\com\android\i18n\phonenumbers\geocoding\data进去,得到的新文件放回system/framework/

然后修改ext.jar文件权限为rw-r-r,重启手机即可。

附上小米2s MIUI V6特别版修改后的ext.jar

附最终效果图

Screenshot_2014-09-20-22-38-47

 

这里的归属地是中文显示的,原谅我不会换成拼音,凑合着用吧。

最后: 其实文章写给自己看的~ 纯备份

评论(0)
10年前说

蛋疼的zeroclipboard js在本地运行不生效,我以为我哪里写错了呢 搞死人了,还好机灵,放在服务器上测试了

评论(0)
10年前说

开启友情链接选项

  1. add_filter( 'pre_option_link_manager_enabled', '__return_true' );

调用

  1. <?php $bookmarks = get_bookmarks('orderby=rand&limit=50&category=');if ( !emptyempty($bookmarks) ) {foreach ($bookmarks as $bookmark) {echo '<li><a href="' . $bookmark->link_url . '" title="' . $bookmark->link_description . '" target="_blank" >' . $bookmark->link_name . '</a></li>';}} ?>