I've had some problems with a image rotator function for drupal 6.2 discussed on this thread: http://drupal.org/node/229409
My problem is explained on the last post..

Could someone please help?

Comments

workbench’s picture

Status: Needs review » Closed (won't fix)
workbench’s picture

Status: Closed (won't fix) » Needs review

I've found the solution! Noticed one / to many when I reviewed the source upon loading the page.

Wrong code in page.tpl.php:

<div id="header-image">
<img src="<?php print base_path() ?>/<?php print path_to_theme() ?>/img/header/0.jpg" alt="header image 0" />
<img style="display:none;" src="<?php print base_path() ?>/<?php print path_to_theme() ?>/img/header/1.jpg" alt="header image 1" />
<img style="display:none;" src="<?php print base_path() ?>/<?php print path_to_theme() ?>/img/header/2.jpg" alt="header image 2" />

Correct code in page.tpl.php:

<div id="header-image">
<img src="<?php print base_path() ?><?php print path_to_theme() ?>/img/header/0.jpg" alt="header image 0" />
<img style="display:none;" src="<?php print base_path() ?><?php print path_to_theme() ?>/img/header/1.jpg" alt="header image 1" />
<img style="display:none;" src="<?php print base_path() ?><?php print path_to_theme() ?>/img/header/2.jpg" alt="header image 2" />

And now it's working! :)

This is the full code to make it work;

page.tpl.php

<div id="header-image">
<img src="<?php print base_path() ?><?php print path_to_theme() ?>/img/header/0.jpg" alt="header image 0" />
<img style="display:none;" src="<?php print base_path() ?><?php print path_to_theme() ?>/img/header/1.jpg" alt="header image 1" />
<img style="display:none;" src="<?php print base_path() ?><?php print path_to_theme() ?>/img/header/2.jpg" alt="header image 2" />

template.php

drupal_add_js(path_to_theme('fourseasons') . '/innerfade/jquery.innerfade.js');
drupal_add_js('
$(document).ready(function(){
  $("#header-image img").show();
  $("#header-image").innerfade({
    speed: 1000,
    timeout: 6000,
    type: "sequence",
    containerheight: "80px"
  });
});
', inline);
?>

Good luck. This works fine in Drupal 6.2 and the latest four seasons theme!

Vially’s picture

Works for me. Thanks !