简体   繁体   English

将效果应用于jquery-ui选项卡

[英]Applying effects to jquery-ui tabs

Is it possible to apply an effect to a jquery-ui tab, I haven't seen any examples of it, and I'm fairly sure that if it is possible the following is incorrect: 是否可以将效果应用于jquery-ui选项卡,我还没有看到它的任何示例,我很确定如果可能以下内容不正确:

<script type="text/javascript">
    $(function() {
        $("#tabs").tabs();
        $("#tabs").effect(slide,options,500,callback);
    });
</script>

You can do something like this, if you want the effect to happen when you change tags using the fx option : 如果您希望在使用fx选项更改标记时发生效果,则可以执行此类操作:

$(function() {
  $("#tabs").tabs( { fx: { height: 'toggle' } } );
});

A fade + slide would be like this: 淡出+幻灯片将是这样的:

$(function() {
  $("#tabs").tabs( { fx: { height: 'toggle', opacity: 'toggle' } } );
});

This applies the effects to the tabs themselves, you can take it for a spin here . 会将效果应用于标签本身, 您可以在此处旋转

  $(function () {
        $("#tabs").tabs({
            beforeLoad: function (event, ui) {
                if (ui.tab.data("loaded")) {
                    event.preventDefault();
                    return;
                }
                ui.ajaxSettings.cache = false,
                ui.panel.html('<img src="images/loader.gif" width="24" height="24" style="vertical-align:middle;"> Loading...'),
                ui.jqXHR.success(function() {
                    ui.tab.data( "loaded", true );
                }),
                ui.jqXHR.error(function () {
                    ui.panel.html(
                    "Couldn't load Data. Plz Reload Page or Try Again Later.");
                });
            }
        });
    });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM