jqueryui对话框,幻灯片的方向

时间:2009-09-26 19:07:34

标签: jquery jquery-ui

我正在使用jquery对话框并希望在节目上滑动。如何指定幻灯片的方向?

$('.selector').dialog({ show: 'slide' });

4 个答案:

答案 0 :(得分:3)

要控制方向,您可以使用' slideUp' /' slideDown'而不是' slide'。

$('.selector').dialog({ show: 'slideDown', hide: 'slideUp' });

答案 1 :(得分:2)

考虑这些链接:

- Dialog - show with effect and options(2009年5月,所以   - Is possible to have more granular control over jQuery UI Dialog Widget’s show/hide method?

似乎不可能,至少目前的版本......

答案 2 :(得分:2)

我以这种方式解决问题: 我在对话框部分编辑了UI文件“jquery-ui-1.7.2.custom.min.js”

原始代码:

d.show(e.show);// <--or iDialog.show(options.show) in ui.dialog.js

修改后的代码:

d.show(e.show,e.showOpt); // or iDialog.show(options.show,options.showOpt) in ui.dialog.js

我创建了一个对话框,添加了一个新参数“showOpt”,它可以包含jquery效果选项

$j( "#dialog_box" ).dialog({
    modal: true,
    width:500,
    height:500,
    show: "slide",
    showOpt: {direction: 'up'}
    });

答案 3 :(得分:1)

这适用于JQuery 2和JQuery UI 1.11:

template <typename Func> struct result_of_function;

template <typename Ret, typename ...Args>
struct result_of_function<std::function<Ret(Args...)>>
{
    using type = Ret;
};

template <typename... Tuples> struct tuple_ret_function;

template <typename... Funcs>
struct tuple_ret_function<std::tuple<Funcs...>>
{
    using type = std::tuple<typename result_of_function<Funcs>::type...>;
};

请注意,“右”方向从右向左滑动。

相关问题