Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/442.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 像Photosweep中的按钮_Javascript_Jquery_Ajax_Photoswipe - Fatal编程技术网

Javascript 像Photosweep中的按钮

Javascript 像Photosweep中的按钮,javascript,jquery,ajax,photoswipe,Javascript,Jquery,Ajax,Photoswipe,我有Photosweep和它的工作良好,但我想添加喜欢和评论按钮在底部。我已经添加了这些按钮,并且还添加了注释输入字段,但我希望在服务器中保存一条类似的注释,而不刷新页面,这是我的代码,其中包含“喜欢”和“不喜欢”,如果单击“注释”按钮,我想在photswipe上显示注释 我的名字是这个 总代码在这里。服务器部分我可以插入mysql查询以更新like按钮和插入查询以获取评论请在jquery/Photoswip部分中帮助如何操作到服务器部分 <!DOCTYPE html>

我有Photosweep和它的工作良好,但我想添加喜欢和评论按钮在底部。我已经添加了这些按钮,并且还添加了注释输入字段,但我希望在服务器中保存一条类似的注释,而不刷新页面,这是我的代码,其中包含“喜欢”和“不喜欢”,如果单击“注释”按钮,我想在photswipe上显示注释

我的名字是这个

总代码在这里。服务器部分我可以插入mysql查询以更新like按钮和插入查询以获取评论请在jquery/Photoswip部分中帮助如何操作到服务器部分

       <!DOCTYPE html>
      <html>
      <head>
        <title>jQM Complex Demo</title>
     <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
      <link rel="stylesheet" href="http://www.photoswipe.com/latest/photoswipe.css" />        
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
            <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://www.photoswipe.com/latest/lib/klass.min.js"></script>            
        <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>            
        <script src="http://www.photoswipe.com/latest/code.photoswipe.jquery-3.0.4.min.js"></script>    <script type="text/javascript">$(document).on('pagebeforeshow', '#index', function(){   
var myPhotoSwipe = $(".gallery li a").photoSwipe({
    getToolbar: function(){
        return '<div class="ps-toolbar-close" style="padding-top: 12px;">Back</div><div class="ps-toolbar-play" style="padding-top: 12px;">Play</div><div class="ps-toolbar-previous" style="padding-top: 12px;">Previous</div><div class="ps-toolbar-next" style="padding-top: 12px;">Next</div><div class="ps-toolbar-close second-like" style="padding-top: 12px;">Like</div><div class="ps-toolbar-close second-comment" style="padding-top: 12px;"><form id="pc_form" method="post" action="" ><input type="text" id="pc_message" onkeyup="lookup(this.value);"  placeholder="Your comment please.press enter to submit " name="message" style="width:200px" rows="15" /><input type="hidden" name="pid" value="1928128" /><input id="pc_submit" name="submit" type="hidden" value="Comment" /></form></div>';
    },
    jQueryMobile: true,
    loop: false,
    enableMouseWheel: true,
    enableKeyboard: true
     });

     myPhotoSwipe.addEventHandler(window.Code.PhotoSwipe.EventTypes.onShow, function(e) {
        $(document).off('click', '.second-close').on('click', '.second-close', function(){    
         e.target.hide();
      });
   });


     //<div class="ps-toolbar-close" style="padding-top: 12px;">View All</div>
     myPhotoSwipe.show(0);      
  });
  </script>    
    </head>
     <body>
       <div data-role="page" id="index">
         <div data-theme="b" data-role="header">
             <h1>Index page</h1>
           </div>

          <div data-role="content">
              <ul class="gallery">           
                    <li><a href="http://www.photoswipe.com/latest/examples/images/full/001.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/001.jpg" alt="Image 001" /></a></li>
                   <li><a href="http://www.photoswipe.com/latest/examples/images/full/002.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/002.jpg" alt="Image 002" /></a></li>
                <li><a href="http://www.photoswipe.com/latest/examples/images/full/003.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/003.jpg" alt="Image 003" /></a></li>
                <li><a href="http://www.photoswipe.com/latest/examples/images/full/004.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/004.jpg" alt="Image 004" /></a></li>
                <li><a href="http://www.photoswipe.com/latest/examples/images/full/005.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/005.jpg" alt="Image 005" /></a></li>
                <li><a href="http://www.photoswipe.com/latest/examples/images/full/006.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/006.jpg" alt="Image 006" /></a></li>
                <li><a href="http://www.photoswipe.com/latest/examples/images/full/007.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/007.jpg" alt="Image 007" /></a></li>
                <li><a href="http://www.photoswipe.com/latest/examples/images/full/008.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/008.jpg" alt="Image 008" /></a></li>
                <li><a href="http://www.photoswipe.com/latest/examples/images/full/009.jpg" rel="external"><img src="http://www.photoswipe.com/latest/examples/images/thumb/009.jpg" alt="Image 009" /></a></li>
             </ul>
          </div>
       </div>    
    </body>
    </html>   

jQM复杂演示
$(document).on('pagebeforeshow','#index',function(){
var myphotosweep=$(“.gallery li a”).photosweep({
getToolbar:函数(){
返回“backuplypreviousnextlike”;
},
jQueryMobile:没错,
循环:false,
enableMouseWheel:正确,
启用键盘:true
});
myphotosweep.addEventHandler(window.Code.photosweep.EventTypes.onShow,函数(e){
$(document).off('click','second close')。on('click','second close',function(){
e、 target.hide();
});
});
//查看所有
myphotosweep.show(0);
});
索引页

您需要向我们展示您在服务器上所做的工作-side@ShawnTaylor服务器端将使用简单的php/mysql代码将数据保存在mysqloh中,我想我不清楚问题是什么。你能澄清一下吗?此外,bootply不起作用也无济于事(您不能在html页面中加载css/js-必须将它们添加到外部资源中,并且必须按正确的顺序):/