【发布时间】: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).
我正在使用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