Build a marquee like BBC

Help me integrate in my website this kind of marquee, or scroll text:

Don’t know how to start, because i don’t understand how they done it. I have tried to understand the code but i couldn’t.

You have quite a few tutorials on how to do that, especially with jQuery.

jQuery Plug-in

JQuery function

Thanks for the quick answer, but i have some problems finding out how to run the jquery code, do i need a soft or something? Sorry i am a noob in jquery, i know some php, and html advanced, but jquery: none;

jQuery is just a library. You need to download it and then link it to the page so you can build your custom functions, or link to a copy of jQuery directly from Google’s servers.

<!doctype html>
    <script type="text/javascript" src="jquery.js"></script> 

Once you have jQuery loaded, you can use it to create new functions based on those that are already built in it.

jQuery’s documentation

I have done the following, i have copied and paste the codes from the first tutorial. Done as you said, added the jquery.js, but it doesn’t work.
Have a look at code, please correct me if i am wrong:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>
<html xmlns=“” <?php language_attributes(); ?>>
<head profile=“”>
<meta http-equiv=“Content-Type” content=“<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />
<title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
<meta name=“generator” content=“WordPress <?php bloginfo(‘version’); ?>” /> <!-- leave this for stats –>
<meta name=“description” content=“<?php bloginfo(‘description’) ?>” />
<meta name=“keywords” content=“” />
<link rel=“stylesheet” href=“<?php bloginfo(‘stylesheet_url’); ?>” type=“text/css” media=“all” />
<link rel=“alternate” type=“application/rss+xml” title=“<?php bloginfo(‘name’); ?> RSS Feed” href=“<?php bloginfo(‘rss2_url’); ?>” />
<link rel=“pingback” href=“<?php bloginfo(‘pingback_url’); ?>” />
<link rel=“Shortcut Icon” href=“” type=“image/x-icon” />
<script type=“text/javascript” src=“<?php bloginfo(‘template_directory’); ?>/js/jquery-1.2.6.min.js”></script>
<script type=“text/javascript” src=“<?php bloginfo(‘template_directory’); ?>/js/jquery-ui-personalized-1.5.2.packed.js”></script>
<script type=“text/javascript” src=“<?php bloginfo(‘template_directory’); ?>/js/sprinkle.js”></script>
<script type=“text/javascript” src=“<?php bloginfo(‘template_directory’); ?>/js/glide.js”></script>

<link rel=“stylesheet” type=“text/css” href=“<?php bloginfo(‘template_directory’); ?>/minipost.css” media=“screen” />
<link rel=“stylesheet” type=“text/css” href=“<?php bloginfo(‘template_directory’); ?>/glide.css” media=“screen” />
<script src=“” type=“text/javascript”></script>
<script src=“” type=“text/javascript”></script>
<script type=“text/javascript”><!–//–><![CDATA-[//><!–
sfHover = function() {
if (!document.getElementsByTagName) return false;
var sfEls = document.getElementById(“menu”).getElementsByTagName(“li”);
var sfEls1 = document.getElementById(“catmenu”).getElementsByTagName(“li”);
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), “”);
for (var i=0; i<sfEls1.length; i++) {
sfEls1[i].onmouseover=function() {
this.className+=" sfhover1";
sfEls1[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover1\\b"), “”);
if (window.attachEvent) window.attachEvent(“onload”, sfHover);

<!–[if lte IE 6]>
<script type=“text/javascript”>
/* <![CDATA[ /
blankimgpath = ‘<?php bloginfo(‘template_url’); ?>/images/blank.gif’;
]]> */
<style type=“text/css” media=“screen”>
img { behavior: url(“<?php bloginfo(‘template_url’); ?>/js/”); }

<?php wp_get_archives(‘type=monthly&format=link’); ?>
<?php //comments_popup_script(); // off by default ?>
<?php wp_head(); ?>


<script language=JavaScript>

//Disable right mouse click Script
//By Maximus ( w/ mods by DynamicDrive
//For full source code, visit

var message="Copyright ©2011 - Real Estate Tips ";

function clickIE4(){
if (event.button==2){
return false;

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;

if (document.layers){
else if (document.all&&!document.getElementById){

document.oncontextmenu=new Function(“alert(message);return false”)

// –>
<div id=“wrapper”>
<div id=“topbar”>

<span class=“day”><?php echo date('j ‘); ?></span>
<div class=“year”>
<span class=“mony”><?php echo date(’ F - Y ‘); ?></span><br/>
<span class=“dname”><?php echo date(’ l '); ?></span>
<span class=“socialnet”><iframe src=“;layout=button_count&amp;show_faces=true&amp;width=60&amp;action=like&amp;colorscheme=light&amp;height=21” scrolling=“no” frameborder=“0” style=“border:none; overflow:hidden; width:65px; height:21px;” allowTransparency=“true”></iframe>
<a href=“” class=“twitter-share-button” data-url=“” data-count=“horizontal”>Tweet</a><script type=“text/javascript” src=“”></script>

<span class=“rsnews”>
<a href=“<?php bloginfo(‘rss2_url’); ?>”> SUBSCRIBE TO NEWS </a><br/>
<a href=“<?php bloginfo(‘comments_rss2_url’); ?>”>SUBSCRIBE TO COMMENTS</a>

<div id=“top”>

<div class=“blogname”>
<h1><a href=“<?php bloginfo(‘siteurl’);?>/” title=“<?php bloginfo(‘name’);?>”><?php bloginfo(‘name’);?></a></h1>


<?php include (TEMPLATEPATH . ‘/headbanner.php’); ?>

<div id=“foxmenucontainer”>
<div id=“menu”>
<li><a href=“<?php echo get_settings(‘home’); ?>”>Home</a></li>
<li class=“page_item page-item-8”><a href=“” title=“Resources”>Resources</a></li>

<li><a href=“”>Forum</a></li>

<div class=“clear”></div>
<div id=“catmenucontainer”>
<div id=“catmenu”>
<?php wp_list_categories(‘sort_column=name&title_li=&depth=4’); ?>

  &lt;div id="scrollup"&gt;

    &lt;div class="headline"&gt;

Latest News

<div class=“clear”></div>
<div id=“casing”>

I haven’t read the code because I couldn’t help to observe that you use WordPress. WP is a bit special with jQuery. It comes packed with it, as you can see in your code

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-ui-personalized-1.5.2.packed.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/sprinkle.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/glide.js"></script>

The very first line tells you that you’re using jQuery version 1.2.6. This is an old version.

Do you use FireFox and FireBug? It will save you tons of time to test your jQuery instead of having to write the function on the page and then re-load it to see if works :slight_smile:

I would use a higher version. 1.2 is old. You only need to copy the appropiate file in the appropiate folder and change the appropiate <script> line so it calls to the right file.

So can you please paste the code of the version that you use.

Hey i managed to make it run, but now i don’t understand why is it show vertical, have a look

Where do you keep the code? scrollup.js?

in, where the index is, and the style css:

this is the code for scrollup.js

<script type=“text/javascript”>
var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;

headline_count = $(“div.headline”).size();

headline_interval = setInterval(headline_rotate,10000); //time in milliseconds
$(‘#scrollup’).hover(function() {
}, function() {
headline_interval = setInterval(headline_rotate,10000); //time in milliseconds

function headline_rotate() {
current_headline = (old_headline + 1) % headline_count;
$(“div.headline:eq(” + old_headline + “)”).animate({top: -205},“slow”, function() {
$(“div.headline:eq(” + current_headline + “)”).show().animate({top: 5},“slow”);
old_headline = current_headline;

and for the css

#scrollup {
position: relative;
overflow: hidden;
border: 1px solid #000;
height: 30px;
width: 100%;

  .headline {
    position: absolute;
    top: 210px;
    left: 5px;
    height: 30px;

.headline a {

Hey, i managed to make it horizontal, but now I have encountered another problem: i have input 3 headlines, and when the pages load, all of the free headline are showed in the same place, and until they start scrolling you can’t understand anything. Have a look. And Thank you for helping me.

You’re doing a great job and should be proud of yourself. I’ll take a look at it and let you know if I can find the problem.

I’m not sure, but it looks like your script and your css place your headlines in the same position. Can’t confirm it though because I don’t have the HTML related to the headlines. You didn’t post it before… would it be possible for you to post the HTML?