TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,996
  • Total Topics: 21,327
  • Online today: 111
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 92
  • Total: 92

Static height for fading image block ?

Started by nevermore, June 06, 2006, 05:33:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nevermore

I have an image fader/rotator at the bottom right block that Elpvn helped me with. Currently, the block height changes with the height of the image causing undesireable resizing of the block. How would I specify the block to be a specific height and then align the images vertically in the block?

www.tagamers.com

IchBin

Well for one, we'd need to see the code. But heres some info that might be helpful to you.

http://www.domedia.org/oveklykken/css-div-scroll.php

nevermore

Here is what is currently in use.

Quote<center><script language="JavaScript1.1">


//*****************************************

//specify interval between slide (in mili seconds)
var slidespeed=2500

//specify images
var slideimages=new Array("http://www.tagamers.com/images/gamepics/retiredgames/uo.jpg","http://www.tagamers.com/images/gamepics/retiredgames/ta.gif","http://www.tagamers.com/images/gamepics/retiredgames/q2.gif","http://www.tagamers.com/images/gamepics/retiredgames/d2.jpg","http://www.tagamers.com/images/gamepics/retiredgames/rtcw.gif","http://www.tagamers.com/images/gamepics/retiredgames/cncgzh.jpg","http://www.tagamers.com/images/gamepics/retiredgames/et.jpg","http://www.tagamers.com/images/gamepics/retiredgames/bfv.jpg")

//specify corresponding links
var slidelinks=new Array("http://www.uo.com","http://en.wikipedia.org/wiki/Total_annihilation","http://en.wikipedia.org/wiki/Quake_2","http://www.blizzard.com/diablo2/","http://en.wikipedia.org/wiki/Return_To_Castle_Wolfenstein","http://www.ea.com/official/cc/firstdecade/us/zerohour.jsp","http://en.wikipedia.org/wiki/Enemy_territory","http://www.ea.com/official/battlefield/vietnam/us/home.jsp")

var newwindow=1 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder=new Image()
imageholder.src=slideimages
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}

//-->
</script>


<a href="javascript:gotoshow()"><img src="http://www.master3d.net/adv/awards_04_06.jpg" name="slide" alt="Games we used to play" border=0 style="filter:blendTrans(duration=3)" ></a>

<script language="JavaScript1.1">
<!--

var whichlink=0
var whichimage=0
var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()

//-->
</script></center>
Quote

gerrymo

Have you tried putting it into a single cell table, with a fixed height? Something like:


  <table border="0" cellpadding="5" cellspacing="3" width="100%" height="150">
    <tr>
      <td width="100%">Script here</td>
    </tr>
  </table>

gerrymo

I've been trying you code out on a test site, but no joy.

But I think I've leaned it up a little. Try:


<center><script language="JavaScript1.1">


//*****************************************

//specify interval between slide (in mili seconds)
var slidespeed=2500

//specify images
var slideimages=new Array("http://www.tagamers.com/images/gamepics/retiredgames/uo.jpg","http://www.tagamers.com/images/gamepics/retiredgames/ta.gif","http://www.tagamers.com/images/gamepics/retiredgames/q2.gif","http://www.tagamers.com/images/gamepics/retiredgames/d2.jpg","http://www.tagamers.com/images/gamepics/retiredgames/rtcw.gif","http://www.tagamers.com/images/gamepics/retiredgames/cncgzh.jpg","http://www.tagamers.com/images/gamepics/retiredgames/et.jpg","http://www.tagamers.com/images/gamepics/retiredgames/bfv.jpg")

//specify corresponding links
var slidelinks=new Array("http://www.uo.com","http://en.wikipedia.org/wiki/Total_annihilation","http://en.wikipedia.org/wiki/Quake_2","http://www.blizzard.com/diablo2/","http://en.wikipedia.org/wiki/Return_To_Castle_Wolfenstein","http://www.ea.com/official/cc/firstdecade/us/zerohour.jsp","http://en.wikipedia.org/wiki/Enemy_territory","http://www.ea.com/official/battlefield/vietnam/us/home.jsp")

var newwindow=1 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder=new Image()
imageholder.src=slideimages
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}

//-->
</script>


<a href="javascript:gotoshow()" border=0 style="filter:blendTrans(duration=3)">Games We Used To Play</A>

<script language="JavaScript1.1">
<!--

var whichlink=0
var whichimage=0
var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()

//-->
</script></center>


(I'm quite new to Javascript, so it may not be perfect).

whoesa

This is not working for me. I put this code in script block and it only shows: Games we used to play. 

I only changed the urls in:
//specify images                           
var slideimages=new Array

and in here:
//specify corresponding links
var slidelinks=new Array

to what i should be for my site.

Anyone could help me to get this working?

Thank you

Xarcell

I believe it takes the height of the tallest picture so to speak. Isn't anything you can do about it, unless you wanna reload the page each time. Add some ajax to get the desired effect.

whoesa

Well im only looking for a script like this fading image rotator script and use each image for a link to an other page.
Somehow i can't get any script to work  ???

I tried this script here but i can't get this working to:
http://www.tinyportal.net/smf/index.php?topic=4220.60

I use onle images with the same width and height.

This website is proudly hosted on Crocweb Cloud Website Hosting.