简体   繁体   English

Java ZK + Javascript JQuery Galleria IO FullScreenMode

[英]Java ZK+Javascript JQuery Galleria IO FullScreenMode

i am using Galleria plugin for JavaScript i need show the image in full Screen mode i have checked the API and have a method. 我正在使用适用于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 API

i am using ZK Framework responding to a button click using this code. 我正在使用ZK Framework响应使用此代码的按钮单击。

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

but nothing happens i have also try using 但没有任何反应,我也尝试使用

Clients.evalJavaScript("imageZoomer()"); 

and a javascript function like this 和这样的javascript函数

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

the above function is called but nothing happens but if a try this code on firebug console 调用了上述函数,但是什么也没有发生,但是如果在Firebug控制台上尝试此代码

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

it works smoothly what i am doing wrong thanks a lot. 非常顺利,我做错了,非常感谢。

finally i could solved my issue using a xmhtml button in ZK and responding onClick event using JQuery i couldn't solve my issue using ZK button here is my code i hope i really helps somebody. 最后,我可以使用ZK中的xmhtml按钮解决问题,并使用JQuery响应onClick事件。我无法使用ZK button解决问题,这是我的代码,希望对您有所帮助。

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

best regards.. 最好的祝福..

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

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