【问题标题】:Java ZK+Javascript JQuery Galleria IO FullScreenModeJava ZK+Javascript JQuery Galleria IO FullScreenMode
【发布时间】:2013-09-04 00:11:28
【问题描述】:

我正在为 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()"); 

还有一个像这样的javascript 函数

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');})

我做错了什么,它运行顺利,非常感谢。

【问题讨论】:

    标签: java javascript jquery zk galleria


    【解决方案1】:

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

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

    最好的问候..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多