小编dne*_*man的帖子

jquery移动幻灯片反向转换显示转换中间的空白页

出于某种原因,在ipad上,我的jquery移动幻灯片在页面之间的过渡是完美的,当它是默认向左滑动[slide]时.但是当它向右滑动[向后滑动]时,在过渡期间页面之间似乎有一个完整的空白页.

<div data-role="page" id="zine1">
   <div data-role="content">    
              VARIOUS HTML CONTENT
   </div><!-- /content -->
</div>
<div data-role="page" id="zine2">
   <div data-role="content">    
              VARIOUS HTML CONTENT
   </div><!-- /content -->
</div>
<div data-role="page" id="zine3">
   <div data-role="content">    
              VARIOUS HTML CONTENT
   </div><!-- /content -->
</div>
<script>
   $(document).ready(function() {
        window.now = 1;

        //get an Array of all of the pages and count
        windowMax = $('div[data-role="page"]').length; 

        doBind();
    });
    // Functions for binding swipe events to named handlers
    function doBind() {
        $('div[data-role="page"]').live("swipeleft", turnPage); 
        $('div[data-role="page"]').live("swiperight", turnPageBack);
    }

    function …
Run Code Online (Sandbox Code Playgroud)

transition slide ipad jquery-mobile

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

使用Rails,Graphql,Apollo客户端的无效令牌

我试图让一个基本的Rails,Graphql,Apollo-Client设置工作,但在rails侧遇到422个错误'无效的auth令牌'.

我使用apollo看起来不对吗?

它是一个带有graphql gem和apollo客户端的Rails 5应用程序.

const csrfToken = document.getElementsByName('csrf-token')[0].content
const client = new ApolloClient({
  networkInterface: createNetworkInterface({
    uri: '/graphql',
    credentials: 'same-origin',
    headers: {
      'X-CSRF-Token': csrfToken
    }
  }),
});
client.query({
query: gql`
    query Camillo2 {
      user {
        id
        email
        created_at
      }
    }
  `,
})
.then(data => console.log(data))
.catch(error => console.error(error));  
Run Code Online (Sandbox Code Playgroud)

Rails日志:

Started POST "/graphql" for ::1 at 2017-03-10 08:51:58 -0800
Processing by GraphqlController#create as */*
Parameters: {"query"=>"query Camillo2 {\n  user {\n    id\n    email\n    created_at\n    __typename\n  }\n}\n", "operationName"=>"Camillo2", "graphql"=>{"query"=>"query Camillo2 {\n  user {\n …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails authenticity-token graphql apollo-client

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