无论如何,prettyphoto 中有没有让我将参数传递给回调函数
这是我目前的设置
<link rel="stylesheet" href="/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" /> <script src="/js/jquery.prettyPhoto2.js" type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8"> $(文档).ready(函数(){ $("a[rel^='prettyPhoto']").prettyPhoto({ 回调:函数() { $.post('/course/close-video', {topic_id: '13'}); } }); }); </脚本> <a href="/course/play-video/topic_id/<?php echo $topic->topic_id;?>?iframe=true&width=470&height=340" rel="prettyPhoto" title="<?php echo $topic- >topic_name;?>"> <img src="/images/videos/" width="170" height="103" alt="topic_name;?>"/> </a>
注意:我在回调中将主题值硬编码为 13 - 但这应该基于单击的链接。
页面中有多个这样的 a href 标签,每个标签都有一个唯一的 topic_id
那么如何将唯一的 topic_id 传递给回调函数
非常感谢