PDA

View Full Version : Need help with scroller ... please



iNetGurl
02-09-2007, 11:29 AM
1) Script Title: Translucent Scroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/translucentscroll.htm

3) Describe problem: I am trying to add this scroller to my page to display banners as opposed to text links. I know how to do the <a href="whatever"><img src="whatever"> part, and I know to change the height and width above that part to the size of the banner I need displayed.

My problem is when I put the code on my page, instead of centering, it pushes right and cuts half of the banners off. This only happens in IE. In Firefox, it displays properly.

Can anyone help me?

ddadmin
02-09-2007, 12:54 PM
How are you currently centering the script? Since this script uses relative positioning, in IE, you may need to tweak it a bit to get it working right. You may want to view previous threads (http://www.google.com/search?q=site&#37;3Awww.dynamicdrive.com%2Fforums%2F+translucent+ddadmin&query=&do=process&showposts=0&quicksearch=1&s=&qfront=translucent+ddadmin&se=on) on this.

Neural Network
02-09-2007, 01:06 PM
where the "document.write('<div " is added, try adding <center> to the start and </center> at the end of the expression(at the end of where /div is ). worked for me in both FF an IE

ddadmin
02-09-2007, 01:18 PM
Well there's certainly no need to use the CENTER tag, which is deprecated anyway. You can center any a piece of content in general in HTML using a DIV tag:


<div style="margin: auto; text-align: center">
HTML here
SCRIPT HERE etc
</div>

iNetGurl
02-09-2007, 02:25 PM
Thanks for the answers, but I'm still having problems. DD, I did read several threads about this scroller. I used the search feature and found some other threads about this scroller. I also tried putting that stuff you said to put, but it still didn't work.

Neural, I do not know where exactly to put the center. Can you show me where?


document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div></div>')

Can you show me where exactly? I'm sorry, I have limited html knowledge and no javascript knowledge whatsoever.

jscheuer1
02-09-2007, 03:41 PM
From the demo page, addition red:


if (ie4||dom)
document.write('<div style="margin:0 auto;position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div></div>')
else if (document.layers){
document.write('<ilayer id=tickernsmain visibility=hide width='+scroller_width+' height='+scroller_height+' bgColor='+bgcolor+'><layer id=tickernssub width='+scroller_width+' height='+scroller_height+' left=0 top=0>'+scrollercontent[0]+'</layer></ilayer>')
}

To prevent the 1/2 cut off problem, remove all text-align:center and align="center" and <center> that contain the scroller. To work in IE your page requires at least a loose transitional DOCTYPE before the opening <html> tag:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>

iNetGurl
02-10-2007, 12:41 AM
Thank you jscheuer1 for your help. My rotatating banners are displaying properly now.