douwei9759 2012-09-28 14:09
浏览 86

将自定义参数传递给FancyBox

I'm developing a hotel booking and reservation management system.

I have a series of venues, which the user selects via a radio button. Once they select the map button, I want to send the venue name, longitude and latitude data to a Fancy Box window, so Google Maps can begin the process of determining route data, which makes specific use of a route planning tutorial.

I've tried...

function fancyboxLocation(href, venue, lo, la) {
   $.fancybox({
       'hideOnContentClick': true,
       'height': 430,
       'padding': 0,
       'width': 700, 
       'type': 'iframe',
       'href' : href,
       'venue': venue,
       'lo': lo,
       'la': la
   });
}

<a href="javascript:;" onclick="fancyboxLocation('<?php echo config_item('base_url'); ?>venues/locations/route', '<?php echo $venues['name']; ?>', '<?php echo $venues['longitude']; ?>', '<?php echo $venues['latitude']; ?>')" title="Plan Route">

Although the window appears, my personal parameters (venue, lo and la) are being stripped out.

The parameters are finding their way into the fancyboxLocation function, but they're not travelling any further.

Any ideas how I do this?

  • 写回答

3条回答 默认 最新

  • duandian2725 2012-09-28 14:52
    关注

    Maybe you could call ajax content

    $.fancybox({
        'hideOnContentClick': true,
        'height': 430,
        'padding': 0,
        'width': 700, 
        'type': 'iframe',
        'href' : href,
        'ajax' : {
            type    : "POST",
            data    : 'venue='+escape(venue)+'&lo='+escape(lo)+'&la='+escape(la)
        }
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器