here an improved version initializing the marquee using a client side w:onBind event listener http://zkfiddle.org/sample/qjh7h/2-marquee-example
cor3000 ( 2016-03-09 02:25:22 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm looking for a way to display a scrolling text in my ZUL page. So I first tried to use the xhtml marquee tag using the native namespace but, as most of you should already know, the scrolling is a bit jagged.
I've found many ways to improve marquee's scrolling in html pages, using Javascript and jQuery. But, so far, I haven't found any solutions to doing so in a ZUL page. If anyone has any kind of solution I would be glad to read it.
Here is a simple example using a plugin from this site:
<?page title="Marquee Demo" contentType="text/html;charset=UTF-8"?>
<zk>
<script type='text/javascript' src='https://rawgithub.com/aamirafridi/jQuery.Marquee/master/jquery.marquee.min.js'></script>
<script type="text/javascript"><![CDATA[
zk.afterMount(function() {
$('$marquee').marquee();
});
]]></script>
<window title="Marquee Demo" border="normal">
<vlayout>
<div align="center">
<div id="marquee" style="width: 300px; overflow: hidden; border: 1px solid #ccc;">
<label value="This is a marquee" />
</div>
</div>
</vlayout>
</window>
</zk>
Hope that helps. Costas
The div's size does not affect the behavior of the plugin. All plugins are customizable in some extent. So i would suggest to have a look at the creator's site: http://aamirafridi.com/jquery/jquery-marquee-plugin. It's all in there.
If you are in a hurry here is a sample changing the marquee's speed and direction:
<script type="text/javascript"><![CDATA[
zk.afterMount(function() {
$('$marquee').marquee({
// set the speed in milliseconds
duration: 10000,
// set the delay time before start
delayBeforeStart: 0,
// set the direction
direction: "right",
// effect of continues flow
duplicated: false
});
});
]]></script>
Hope that helps. Costas
I have this error in IE and Chrome :
GRAVE: [Desktop z_2gd:/index.zul] client error: Failed to mount: $(...).marquee is not a function
Here my code :
<?page title="" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="About" border="normal" closable="true" width="300px" height="250px" apply="net.tmesrl.classes.AboutViewCtrl">
<script src="./script/jquery-ui-1.8.7.custom.min.js" type="text/javascript"></script>
<script type="text/javascript" src="./script/jquery.marquee.min.js"><![CDATA[
zk.afterMount(function() {
$('$marquee').marquee({
direction: "right"
});
});
zk.afterMount(function() {
$('$marquee2').marquee();
});
zk.afterMount(function() {
$('$marquee3').marquee({
direction: "right"
});
});
]]></script>
<vlayout>
<div align="center">
<div id="marquee" style="width: 250px; overflow: hidden; border: 1px solid #ccc;">
<image id="imgGarby" src="./images/rsz_logo_garby.png"></image>
</div>
</div>
</vlayout>
<separator></separator>
<vlayout>
<div align="center">
<div id="marquee2" style=" width: 250px; overflow: hidden; border: 1px solid #ccc; background: #ccc;">
<label id="lblAbout" value=""></label>
</div>
</div>
</vlayout>
<separator></separator>
<vlayout>
<div align="center">
<div id="marquee3" style=" width: 250px; overflow: hidden; border: 1px solid #ccc; background: #ccc;">
<label id="lblAbout2" value=""></label>
</div>
</div>
</vlayout>
<separator></separator>
<vlayout>
<div align="center">
<button id="btnclose" label="Chiudi"></button>
</div>
</vlayout>
</window>
</zk>
>
Hi napule77,
I tried your example with a few minor changes on zk fiddle, and it just works:
http://zkfiddle.org/sample/qjh7h/1-marquee-example
Robert
here an improved version initializing the marquee using a client side w:onBind event listener http://zkfiddle.org/sample/qjh7h/2-marquee-example
cor3000 ( 2016-03-09 02:25:22 +0800 )editAsked: 2014-04-15 10:00:17 +0800
Seen: 64 times
Last updated: Mar 09 '16
Facing issue in masking on phone [closed]
How to update ZK Grid values from jQuery
How can I use a newer version of jQuery?
Applet integration - How can i get the html tag id in javascript?
Placeholder with phonemasking in IE11 Browser not working
Customize ZK's JavaScript Code
How to combine jQuery's .fadeOut with server side .removeChild ?