Java ZK+Javascript JQuery Galleria IO FullScreenMode

Java ZK+Javascript JQuery Galleria IO FullScreenMode

本文关键字:IO FullScreenMode Galleria JQuery ZK+Javascript Java      更新时间:2023-09-26

我正在使用JavaScript的Galleria插件,我需要在full Screen mode中显示图像,我已经检查了API并有了一个方法。

.enterFullscreen( [callback] )
returns Galleria
This will set the gallery in fullscreen mode. It will temporary manipulate some document  styles and blow up the gallery to cover the browser screen. Note that it will only fill the browser window, not the client screen (javascript can’t do that).

API

我使用ZK Framework来响应使用此代码的按钮点击。

public void imageZoomer()
{
        Clients.evalJavaScript("$('#galleria').data('galleria').enterFullscreen(function() {alert('full screen mode');})");     
}

但什么也没发生,我也试过使用

Clients.evalJavaScript("imageZoomer()"); 

和类似的CCD_ 5功能

function imageZoomer()
{
alert('before');
$('#galleria').data('galleria').enterFullscreen(function(){alert('full screen mode');})
alert('after');
}

调用了上面的函数,但没有发生任何事情,但如果在firebug控制台上尝试此代码

$('#galleria').data('galleria').enterFullscreen(function(){alert('full screen mode');})

我做错了什么都很顺利,非常感谢。

最后,我可以使用ZK中的xmhtml按钮来解决我的问题,并使用JQuery响应onClick事件。我无法使用ZK button来解决问题。这是我的代码,我希望我真的能帮助到别人。

<div xmlns:h="xhtml">
   <h:button onclick="$('#galleria').data('galleria').toggleFullscreen();">Full Screen.          </h:button>
</div>

致以最良好的问候。。