registrieren

Freitag, 3. September 2010
JQuery Fading Newsticker
  • 24.02.2008 - Nightwish in Stuttgart

    24.02.2008 - Nightwish in Stuttgart von joe (25.02.2008)

    Mit etwas gemischten Gefühlen und leisen Zweifeln fuhr ich am Sonntag zur Hanns-Martin-Schleyer Halle. Nightwish habe ich noch nicht allzulange auf meiner Favoritenliste. Würde Nightwish live so perfekt spielen wie auf Ihren Alben - und könnte die neue Sängerin Annette Olzon das Versprechen einlösen, das sie in "Dark Passion Play" gab?

    Gegen 23:45 fuhr ich völlig begeistert wieder nach Hause...

  • Stereoanlage

    Stereoanlage von lucas (19.01.2008)

    Zu Weihnachten habe ich viel Geld bekommen. Eigentlich wollte ich mir ein cosmic tc kaufen, aber der Bauer hat unsere Drachenwiese umgepflügt und bei uns sind so schlechte Windverhältnise.
    Deshalb habe ich mir eine Stereoanlage mit so einem Streamium-Teil (Terratec Noxon 2) bestellt...

  • Kiki im Wald

    Kiki im Wald von joe (08.12.2007)

    Was man als Hund so alles mitmachen muss, wenn die Familie einen Spaziergang im Wald macht...
    Ein neuer Comic aus der beliebten Serie "Leben im wolfsbau".
    Hauptpersonen: Kiki, Lisa & Lucas

  • Cosmic Ghost mit wolfsbau Werbefoto

    Cosmic Ghost mit wolfsbau Werbefoto von joe (21.10.2007)

    Es war ein wunderschönes Drachenfest mit einem stimmungsvollen Nachtfliegen. Vize-Europameister Chris Stahl lenkte den Cosmic traumwandlerisch sicher durch den schwarzen Nachthimmel und meine Nikon D200 malte die Impressionen aus Licht und Form auf den CCD-Chip. Nun ziert eines der schönsten dabei entstandenen Fotos die Werbefläche für den neuen Cosmic.

  • Videos von der Tricksparty Harsewinkel

    Videos von der Tricksparty Harsewinkel von joe (20.10.2007)

    Bart de Ruijter war nicht nur selbst Teilnehmer sondern fand auch noch Zeit einige Balletts auf Video zu bannen. Die Videos geben ganz gut die Null-Leichtwind Bedingungen an beiden Tagen wieder, und zeigen das von den Teilnehmern doch einiges an Laufarbeit und Improvisation gefordert war.



This is cool - How is this done?
I've used the awesome jquery library  and TexoTela's Newsticker plugin. These javascript libraries do the cute visual stuff and automatically take care of cross-browser issues. In this example they are driven by Scott's News Articles Latest module.

First you need to put jquery.js and jquery.newsticker.js on your server. Then place a reference to these libs in the header section of your News Articles Latest module, which you will find under Module Settings / Advanced Settings. In the example below i assume that you placed these libs in a directory named "JS" in your portal's root. Please notice that the names of the libs may differ, because there are different download options (minimized, packed versions etc.).

<script type="text/javascript" src="http://www.mysite.de/JS/jquery.js"></script>
<script type="text/javascript" src="http://www.mysite.de/JS/jquery.newsticker.pack.js"></script>

Please note, that this is just a hack, you would normally place these script-references in the head-Section of your page. This is why i asked Scott to provide a [RegisterOnce] tag which could take care of this.

Next comes the code which actually starts the NewsTicker. This is placed in the footer section of the module (Module Settings / Advanced Settings), although it might work at any place, because it uses the jquery document.ready event to start the action when the document is loaded.

<script type="text/javascript">
jQuery(document).ready(
  function()
  {
    jQuery("#news").newsticker();
  }
);
</script>

That's all Javascript that is need for the Fading Newsticker. Now comes the content. How does the Newsticker know what to fade? Easy enough. The NewsTicker looks for an unordered list with id ="news" and class="newsticker". So all you have to is to create something like:

<ul id="news" class="newsticker">
  <li>my first news</li>
  <li>my second news</li>
  <li>my best news</li>
</ul>

To create the above content i used the News Articles Latest module. In the View options use the Simple Layout and place something like that in the template areas:

HTML Header:

<ul id="news" class="newsticker">


HTML Body:

<li>
<a href=[LINK]>[TITLE]</a>
<p>[IMAGETHUMB:100] by [AUTHORUSERNAME] ([PUBLISHSTARTDATE])</p>
<p>[SUMMARY]</p>
</li>

HTML-Footer:

</ul>

That's it!  Let the magic happen.

Hope this helps,
Joe


  
Datenschutzerklärung   |  Nutzungsbedingungen Copyright 2007 by Wolfsbau
powered by maiersoft internet solutions