0

Smooth silky text scrolling

asked 2014-04-15 10:00:17 +0800

valnay gravatar image valnay
13 2

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.

delete flag offensive retag edit

6 Answers

Sort by ยป oldest newest most voted
0

answered 2014-04-16 14:07:59 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

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

link publish delete flag offensive edit
0

answered 2014-04-24 10:20:31 +0800

valnay gravatar image valnay
13 2

Thx ! It helped a lot.

I have a question though. The scrolling speed seem to be depending on the div size. I'd like to set the scrolling speed in another way if possible. Any idea ?

link publish delete flag offensive edit
0

answered 2014-04-26 08:51:06 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

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

link publish delete flag offensive edit
0

answered 2016-03-01 11:22:53 +0800

napule77 gravatar image napule77
15 3

updated 2016-03-09 01:58:15 +0800

cor3000 gravatar image cor3000
6280 2 7

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>

>

link publish delete flag offensive edit
0

answered 2016-03-09 02:06:45 +0800

cor3000 gravatar image cor3000
6280 2 7

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

link publish delete flag offensive edit

Comments

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
-1

answered 2016-03-01 23:05:05 +0800

Darksu gravatar image Darksu
1991 1 4

Hello napule77,

Please remove the second time you are using jquery.

Best Regards,

Darksu

link publish delete flag offensive edit

Comments

answer seems unrelated

cor3000 ( 2016-03-09 02:08:33 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2014-04-15 10:00:17 +0800

Seen: 64 times

Last updated: Mar 09 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More