小编Lou*_*uis的帖子

检查与phonegap的互联网连接

我看到几个不同的选项来检查与phonegap的互联网连接.有document.addEventListener("online", onOnline, false);,也有navigator.network.connection.type...但我不确定哪一个是最佳实践.我还希望能够防止手机连接到wifi网络但没有互联网连接的坏情况.

$(document).on('pagecreate','#explanation-short', function(){
     if ( isPhoneGap() ) {
    if (checkConnection() == "none" ) {
        connectionStatus = 'offline'; 
    } else {
        connectionStatus = 'online';
    }
    function checkConnection() {
        var networkState = navigator.network.connection.type;
        var states = {};
        states[Connection.UNKNOWN]  = 'Unknown connection';
        states[Connection.ETHERNET] = 'Ethernet connection';
        states[Connection.WIFI]     = 'WiFi connection';
        states[Connection.CELL_2G]  = 'Cell 2G connection';
        states[Connection.CELL_3G]  = 'Cell 3G connection';
        states[Connection.CELL_4G]  = 'Cell 4G connection';
        states[Connection.NONE]     = 'No network connection';
        //console.log('Connection : ' + Connection);
        //console.log('Connection type: …
Run Code Online (Sandbox Code Playgroud)

jquery-mobile cordova

6
推荐指数
1
解决办法
1万
查看次数

固定在ipad上的背景

我无法找到一种方法来正确显示iPad上单页网站的背景图像.

我在视口中有固定的背景,页面在背景上滚动.页面结构如下:

<body class="landing-1-b">
    <div class="container">
        <section class="intro viewportheight_min" id="intro" class="currentSection">
        ...
        </section>
        <section class="keys viewportheight_min" id="keys">
        </section>
        ....
    </div>
</body>
Run Code Online (Sandbox Code Playgroud)

而css是:

body, html, .container, section {
    height: 100%;
    margin:0;
    font-family: "FuturaStd-Light", "sans-serif";
}
html {
    background: url(../img/bg.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)

这可以在桌面浏览器上完美地工作,就像你在网站boardlineapp.com上一样,但它在ipad上不起作用:背景奇怪地缩放,你可以在下面的iPad屏幕截图中看到.你能帮我解决这个问题吗?

谢谢

PS:有是部分答案在这里与背景attachement:滚动.但这并不令人满意.

在此输入图像描述

html css ipad responsive-design

6
推荐指数
1
解决办法
689
查看次数

6
推荐指数
1
解决办法
1485
查看次数

从移动应用程序进行pouchDB/couchDB复制的最佳实践

我在我的混合(Ionic)应用程序中使用pouchDB从我的Cloudant数据库发送和检索数据.

continuous replication到目前为止我已经习惯了,但是交易太多了,服务器的账单也在增加!

你能帮助我用"最佳实践"重写我的代码以避免这种情况吗?

这样声明远程URL是最好的实践,还是应该有数据库的本地副本?

如您所见,我是pouchDB/couchDB的新手,我不明白如何正确管理复制.

谢谢你的帮助!

.factory('usersDatabase', [
    'pouchDB',
    function (pouchDB) {
        'use strict';

        var usersDatabase = pouchDB('boaine_users'),
            remote = 'https://ididi:pwdpwd@myaccount.cloudant.com/boaine_users',
            opts = {
                live: true,
                retry: true
            };
        usersDatabase.replicate.to(remote, opts);
        usersDatabase.replicate.from(remote, opts);

        return usersDatabase;
    }
])
Run Code Online (Sandbox Code Playgroud)

mobile couchdb angularjs pouchdb ionic-framework

6
推荐指数
0
解决办法
599
查看次数

css 样式的 facebook 登录按钮,最佳实践

我在我的 web 应用程序中使用 Facebook登录按钮进行单点登录(下面的代码)。但我不知道如何用 css 控制按钮的样式。我看到 Facebook 插件在我的页面中插入了一个 iframe...

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/fr_CA/all.js#xfbml=1&appId=myid";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-login-button" data-max-rows="1" data-size="large" data-show-faces="false" data-auto-logout-link="true"></div>
Run Code Online (Sandbox Code Playgroud)

但这不会呈现:

.fb-login-button {
    width: 300px !important;
    font-size: 16px !important;
    line-height: 30px !important;
    padding: 3px 8px !important;
}
Run Code Online (Sandbox Code Playgroud)

JSfiddle:http : //jsfiddle.net/4SqGn/

你知道如何控制按钮样式吗?

javascript css iframe facebook

5
推荐指数
1
解决办法
2万
查看次数

Ionic Framework + Phonegap Build:工作流程

我正在尝试使用Phonegap Build编译我的Ionic应用程序(我正在使用Mac,因此我无法编译到iOS).

什么是最好的工作流程?

谢谢

cordova phonegap-build hybrid-mobile-app ionic

5
推荐指数
2
解决办法
3096
查看次数

离子,在iOS上的键盘上方保持按钮

我需要本页底部的"确定"按钮,以便在打开时保持在键盘上方.它适用于Android,您可以在左侧的屏幕截图中看到,但不能在IOS中看到(右侧的屏幕截图).

你能帮我解决这个问题吗?

此外,你可以看到"选择焦点"指令在iOS中不起作用......键盘应该是iOS上的数字键盘(手机键盘)......而事实并非如此.

然后3个问题;)

这是一个视频:https: //youtu.be/_bOWGMGesgk

Android的 iOS版

这是代码:

<div class="wrapperFlex withNextButton">
<div class="itemTitle">
    <div class="text">
        {{'paramQuestions.weight' | translate }}
    </div>
</div>

<div id="weightdata" class="itemParameters weightdataclass row">

    <input class="weightinput" type="number" name="userweight" ng-min="{{data.minWeight}}" ng-max="{{data.maxWeight}}" ng-model="data.realWeight" ng-change="updateViewGenVol(data.weightunit, data.userweight, data.BLfactorValue);saveUserWeight()" select-on-focus required></input>
    <div class="weightunitradios">
        <ion-checkbox class="checkboxes checkbox-blueboardline" ng-model="data.weightunit" ng-true-value="'kg'" ng-false-value="'lbs'" ng-change="saveWeightUnit(); changeMinMax(); convertWeightInput(); saveUserWeight();">kg</ion-checkbox>
        <ion-checkbox class="checkboxes checkbox-blueboardline" ng-model="data.weightunit" ng-true-value="'lbs'" ng-false-value="'kg'" ng-change="saveWeightUnit(); changeMinMax(); convertWeightInput(); saveUserWeight();">lbs</ion-checkbox>
    </div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)

directives.js:

.directive('selectOnFocus', function ($timeout) {
  return {
      restrict: 'A',
      link: function (scope, element, attrs) {
          var …
Run Code Online (Sandbox Code Playgroud)

android ios angularjs ionic-framework

5
推荐指数
1
解决办法
911
查看次数

如何从启动板安装软件包

我想在我的Ubuntu中安装它:https : //launchpad.net/ubuntu/+source/ttfautohint

但我不知道如何

我做到了sudo apt install ttfautohint,ttfautohint --version版本为0.97。

谢谢

ubuntu

5
推荐指数
2
解决办法
2951
查看次数

删除Woocommerce中重复的导入订单

我在Woocommerce中有重复的订单,我想删除它们只保留独特的清洁簿记.

我不擅长SQL,我写了这个请求但是当有重复时它列出了两个重复.

SELECT *
FROM `wp_posts` 
WHERE post_type = 'shop_order' AND post_status = 'wc-completed' 
GROUP BY post_date 
HAVING count(*) > 1 
ORDER BY `wp_posts`.`post_date` DESC
Run Code Online (Sandbox Code Playgroud)

这给了我307个结果.

如何编写删除重复项的正确请求并仅保留唯一订单?

样本数据:

ID  post_author post_date       post_date_gmt   post_content    post_title  post_excerpt    post_status comment_status  ping_status post_password   post_name   to_ping pinged  post_modified   post_modified_gmt   post_content_filtered   post_parent guid    menu_order  post_type   post_mime_type  comment_count   
22282   227 2018-02-04 01:00:00 2018-02-04 00:00:00     Order &ndash; February 4, 2018 @ 01:00 AM       wc-completed    open    closed      order-4-02-18-6         2018-03-19 17:12:32 2018-03-19 16:12:32     0   https://www.hemen-biarritz.com/?post_type=shop_ord...   0   shop_order      2   
22277   0 …
Run Code Online (Sandbox Code Playgroud)

php mysql sql wordpress orders

5
推荐指数
1
解决办法
448
查看次数

带有 Woocommerce 的 FlexSlider:防止水平滑块上的垂直滑动触摸

使用 WooCommerce 4.2,在 iOS 上,FlexSlider (v2.7.2) 显示一个带有水平滑块的错误:当用户向左或向右滑动时焦点位于滑块上时,垂直滚动仍处于活动状态,存在一定程度的垂直移动. 这使得滑块“反弹”。

您可以在此视频中看到错误:https : //youtu.be/bM8zcv3ciTo

编辑:我的问题类似于this one,但与Flexslider有关。

我在functions.php中有这个:

/*PRODUCT PAGE FlexSlider Options*/
add_filter( 'woocommerce_single_product_carousel_options', 'filter_single_product_carousel_options' );
function filter_single_product_carousel_options( $options ) {
    if ( wp_is_mobile() ) {
        $options['controlNav'] = true; // Option 'thumbnails' by default
        $options['direction'] = "horizontal";
        $options['slideshow'] = false; // Already "false" by default
    }
    return $options;
}
Run Code Online (Sandbox Code Playgroud)

知道如何在焦点位于 Flexslider 上时防止这种垂直滚动吗?

有人也有这个bug吗?

我安装了一个只有 Wordpress 和 WooCommerce 的测试站点,错误就在这里,所以它与插件无关:http : //woo.makemy.biz/produit/produit-de-test/

storefront carousel ios flexslider woocommerce

5
推荐指数
1
解决办法
616
查看次数