Re: [addon] How to make image rollover
Yeah, I was right. Insert the call to the javascript just before the call to the thumbs and replace the thumbs with the new rollover code. Change any instances of "answers" to "new_video" "recent" and "featured_video", etc. (depending on what you want to rotate) and also change the size of the images to what you had it before.
New videos is 80 x 60 for example and the code posted by Rammstein has them at 133 x 100 (...you'll want to change the size of the images to reflect the thumb size you really want on pages other than "recent").
Here's what the "new videos" section of MY index.tpl looks like where I got that part to work to give you an idea of how to do this. (note the colors of the mouseover in the first 2 lines reflects the colors of my site, you may need to adjust that to suit your site).
Code:
{section name=i loop=$new_video}
<td width="25%" align="center" onmouseout="this.style.backgroundColor='#ffffff';" onmouseover="this.style.backgroundColor='#ffffff';">
<SCRIPT type=text/javascript>
stat['{$new_video[i].VID}']=0; thumb['{$new_video[i].VID}']=new Array(); thumbs['{$new_video[i].VID}']=new Array(1,1,1);
</SCRIPT>
<a href="{$baseurl}/view/{$new_video[i].VID}/{$new_video[i].seo_name}/">[img]{$baseurl}/thumb/1_{$new_video[i].VID}.jpg[/img]
{$new_video[i].title|truncate:30:"...":true}</a>
</td>
{if $smarty.section.i.index == 4}</tr><tr valign="top">{/if}
{if $smarty.section.i.index == 9}</tr><tr valign="top">{/if}
{if $smarty.section.i.index == 14}</tr><tr valign="top">{/if}
{/section}
When I get this section working for the featured videos, I'll post that too. The above code is for the entire SECTION to make it a bit easier to find (at least for me, I find that easier).
If it's not fun, stop doing it!
Bookmarks