weixin_33671935 2014-02-01 16:52 采纳率: 0%
浏览 9

像在photowipe中的按钮

i have photoswipe and its working fine but i want to add like and comment button in the bottom. i have added those buttons and comment input field is also added but i want like an comment to be saved in server without refreshing the page, here is my code with like and dislike and i want to show the comments over photswipe if comments button is clicked .

my jsfiddle is this http://jsfiddle.net/dsV2k/1/

and the total code is here. server part i can do with inserting mysql query for update the like button and insert query for comments pleas ehelp in jquery/photoswipe part how to do upto server part

       <!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>   
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求解 yolo算法问题
    • ¥15 虚拟机打包apk出现错误
    • ¥30 最小化遗憾贪心算法上界
    • ¥15 用visual studi code完成html页面
    • ¥15 聚类分析或者python进行数据分析
    • ¥15 三菱伺服电机按启动按钮有使能但不动作
    • ¥15 js,页面2返回页面1时定位进入的设备
    • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
    • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝