我想用qTip传递一个动态参数,但它失败了.my_ajax_controller.php只显示变量类型,但不显示q.
$('a.menu_help').qtip({
content: {
url:'my_ajax_controller.php',
data: 'type=help_menu&q='+$(this).attr('id'),
method: 'get'
},
show: 'mouseover',
hide: 'mouseout'
});
Run Code Online (Sandbox Code Playgroud)
但是,q的静态值有效:
$('a.menu_help').qtip({
content: {
url:'my_ajax_controller.php',
data: 'type=help_menu&q=toto',
method: 'get'
},
show: 'mouseover',
hide: 'mouseout'
});
Run Code Online (Sandbox Code Playgroud)
有没有办法将动态值传递给参数数据?
提前致谢 !
弗洛朗
尝试这样的事情:
$('a.menu_help').each(function(){
$currentLink = $(this);
$currentLink.qtip({
content: {
url:'my_ajax_controller.php',
data: 'type=help_menu&q='+$currentLink.attr('id'),
method: 'get'
},
show: 'mouseover',
hide: 'mouseout'
});
Run Code Online (Sandbox Code Playgroud)
我没有测试过这个,但我做了类似的事情.就是现在找不到它.
| 归档时间: |
|
| 查看次数: |
5800 次 |
| 最近记录: |