0

GalleriaJavaScript のプラグインを使用しています。画像を表示する必要があります。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');})

私が間違っていることはスムーズに機能します。ありがとうございます。

4

1 に答える 1

1

最後にxmhtml、ZK のボタンを使用して問題を解決onClickし、JQuery を使用してイベントに応答することができZK buttonました。

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

よろしくお願いします..

于 2013-09-08T16:49:26.280 に答える