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 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私
    • ¥15 ROS系统搭建请教(跨境电商用途)
    • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。