Well it looked equally bad to me in Firefox, others. With this new setup slide content in the center can't bleed over into the left or be truncated by it until the window gets quite narrow. At which point the video will too. It's just less noticeable because there's nothing there in the left for it to cover/be covered by.
Anyways, you could instead set no width or height on the slideshow, then it would always fit, but the column would jump as the various amounts of content were switched into and out of it.
Then I thought, what if the script could determine the height needed for the show's tallest slide at any given width and adjust again if the window were resized?
So I rewrote the script a bit. It also no longer needs any of the version 4 tests (document.all, document.layers) it had before. No one uses those browsers today. They cannot render an ordinary page.
I mention that because you can also get rid of this version 4 (Netscape 4) bit of the markup:
HTML Code:
<ilayer id="slidensmain" width=&{slidewidth}; height=&{slideheight}; visibility=hide><layer id="slidenssub" width=&{slidewidth}; left=0 top=0></layer></ilayer>
I made it so it would center the slide content vertically within the height that's calculated, so to maximize that visually balancing effect I would further recommend that the header for the video have its top margin set to 0:
Code:
<h2 align="center" style="margin-top:0;">VIDEO OF THE WEEK!</h2>
And I replaced the <br /> tags in the variableslide texts with spaces as, with the width now variable, forced line breaks will at many of the widths look visually odd and arbitrary even if they have a logical reason. Better to let the text be fluid like the layout. Back up a copy of the current ones, just in case you cannot live with these.
Here's the updated script:
Code:
<script type="text/javascript">
/***********************************************
* Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
* modified 1/2012 to adapt to fluid layout widths
***********************************************/
var variableslide=new Array()
//variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]
variableslide[0]=['images/RayTidman.jpg', 'http://www.FanninSentinel.com/features.html', '<p class="posted">Posted Dec. 22, 2011 9:32 p.m.</p><h2>Assisted living facility to come to county</h2><p>Dr. Ray Tidman confirmed that an assisted living facility will be constructed near RiverStone Medical Center. During the Board of Commissioners meeting, Post 1 Commissioner Garnett Webb stated that the long-awaited assisted living facility would be coming to Fannin County “as early as next spring.” Webb said last week he had talked to Henning Construction Co.’s Chris Henning and Tidman about the project and was assured that ground would be broken this spring. Tidman said the partners in the venture are presently working on financing.</p>']
variableslide[1]=['images/TracySummers.jpg', 'http://www.FanninSentinel.com/features.html', '<p class="posted">Posted Dec. 22, 2011 9:32 p.m.</p><h2>Xtreme Teens returns</h2><p>Xtreme Teens—and its coordinator, Tracy Summers—is back. The program, which was terminated Sept. 30, has a new lease on life and a new focus. “They restored funding, but the funding is for alcohol, whereas, in the past, it was for drugs and alcohol,” he said. Read <a href="http://www.fanninsentinel.com/features.html#xtreme">more</a>.</p>']
variableslide[2]=['images/BuddyFinch.jpg', 'http://www.FanninSentinel.com/government.html#McCaysville', '<p class="posted">Posted Dec. 22, 2011 9:32 p.m.</p><h2>McCaysville applies for water loan</h2><p>During the McCaysville City Council meeting Dec. 13, council members approved a loan application to the Georgia Environmental Finance Authority (GEFA) for the water system. “This will be a big help for McCaysville and the outlying communities,” explained Mayor James “Buddy” Finch to Mayor-elect Thomas Seabolt. He added that McCaysville’s water system extends all the way south to Highway 2. Read <a href="http://fanninsentinel.com/government.html#McCaysville">more</a>.</p>']
variableslide[3]=['images/FCSOAwards12-17-11Davenport.jpg', 'http://www.FanninSentinel.com/features.html#FCSO', '<p class="posted">Posted Dec. 22, 2011 9:32 p.m.</p><h2>Sheriff’s Christmas Party includes awards</h2><p>Sheriff Dane Kirby congratulated Deputy Larry Davenport on earning the award for Court Services Officer of the Year. Kirby said Davenport never complains, is always dependable, and is always willing to go the extra mile. The Fannin County Sheriff’s Office awarded staff for their service during its annual Christmas Party Dec. 17 at the Powerhouse. “The Sheriff’s Office voted on these people. They selected their own,” Sheriff Dane Kirby said. Read <a href="http://fanninsentinel.com/features.html#FCSO">more</a>.</p>']
//configure background color of the slideshow
var slidebgcolor='transparent'
//delay between image rotations (in miliseconds)
var slidedelay=9000
////Do not edit pass this line////////////////
var slidewidth='auto'
var slideheight='auto'
for (i=0;i<variableslide.length;i++){
var cacheimage=new Image()
cacheimage.src=variableslide[i][0]
}
var currentslide=0
function rotateimages(notimer){
contentcontainer='<center>'
if (variableslide[currentslide][1]!="")
contentcontainer+='<a href="'+variableslide[currentslide][1]+'">'
contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="5" style="float:left; margin:0 10px 0 0">'
//contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="5">'
if (variableslide[currentslide][1]!="")
contentcontainer+='</a>'
contentcontainer+='</center>'
if (variableslide[currentslide][2]!="")
contentcontainer+=variableslide[currentslide][2]
//if (variableslide[currentslide][3]!="")
//contentcontainer+=variableslide[currentslide][3]
if (document.getElementById)
crossrotateobj.innerHTML=contentcontainer
if(rotateimages.started){
if (currentslide==variableslide.length-1) currentslide=0
else currentslide++
}
if(notimer === true){return;}
setTimeout("rotateimages()",slidedelay)
}
if (document.getElementById)
document.write('<table style="border-collapse:collapse;margin:0;padding:0;"><tr><td id="slidedom" '+
'style="margin:0;padding:0;vertical-align: middle;width:'+
slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+';"></td></tr></table>')
if (document.getElementById){
crossrotateobj = document.getElementById("slidedom");
crossrotateobj.style.visibility = 'hidden';
rotateimages.findHeight = function(w){
var h = 0, c = 0;
if(rotateimages.started){crossrotateobj.style.height = 'auto';}
for(var i = 0; i < variableslide.length; ++i){
if(rotateimages.started){
rotateimages(true);
h = Math.max(h, crossrotateobj.offsetHeight);
} else {
(function(i){
variableslide['im' + i] = new Image();
variableslide['im' + i].onload = variableslide['im' + i].onerror = function(){
currentslide = i;
rotateimages(true);
h = Math.max(h, crossrotateobj.offsetHeight);
if(++c === variableslide.length){
crossrotateobj.style.height = h + 'px';
crossrotateobj.style.visibility = 'visible';
rotateimages.started = true;
currentslide = 0;
rotateimages();
}
};
variableslide['im' + i].src = variableslide[i][0];
})(i);
}
}
if(rotateimages.started){crossrotateobj.style.height = h + 'px';}
}
rotateimages.findHeight(crossrotateobj.parentNode.offsetWidth);
onresize = function(){rotateimages.findHeight(crossrotateobj.parentNode.offsetWidth);};
}
</script>
Bookmarks