css - 更改已显示的 wicket ModalWindow 的样式

标签 css updates wicket-1.6 modal-window

我想在其中一个按钮中发生单击事件后使模态窗口透明(不透明度:0.5)。 我尝试使用:

window.add(AttributeAppender.append("style","color:red; font-weight:bold")); 
or 
window.setCssClassName("custom-modal");

但是这些解决方案都不允许应用所需的样式。

任何帮助将不胜感激!

谢谢

最佳答案

可以使用ModalWindow下面的方法。

setMaskType( ModalWindow.MaskType.SEMI_TRANSPARENT );

检查示例:

            final ModalWindow modal;
            add( modal = new ModalWindow( "modal" ) );

            modal.setCookieName( "modal window" );

            modal.setResizable( false );
            modal.setAutoSize( true );
            modal.setCssClassName( ModalWindow.CSS_CLASS_GRAY );

            modal.setPageCreator( new ModalWindow.PageCreator()
            {
                @Override
                public Page createPage()
                {
                    return new alertPopup( modal );
                }
            } );

            AjaxLink backButton = new AjaxLink<Void>( "previous-button" )
            {
                @Override
                public boolean isVisible()
                {
                    return true;
                }

                @Override
                public void onClick( AjaxRequestTarget target )
                {
                    modal.setMaskType( ModalWindow.MaskType.SEMI_TRANSPARENT );
                    modal.show( target );
                }
            };

关于css - 更改已显示的 wicket ModalWindow 的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25551376/

相关文章:

javascript - 创建后,jquery 选择上面的元素

html - slider 问题

websphere - Wicket 口 + WAS : calling url causes a redirect to a wrong URL causing 404

java - 文件上传字段 Wicket 错误

java - 仅在 iframe 中设置应用程序状态

HTML5 视频上的 jQuery 叠加图像

CSS Flexbox(页眉和内容[溢出 : scroll]) with unknown header height

updates - 更新到 Paw 3 后,paw 文件将无法打开

wordpress - 更新容器内的 WordPress。没有 FTP 访问权限

mysql - 使用多个其他表中的值更新一个表