PDA

View Full Version : centering slideshow



jenphoto
10-27-2009, 01:40 AM
1) Script Title: Ultimate fade-in slideshow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem: How do I centre the slideshow on my web page. The show works well except I need to centre it on the page.
I added a <centre> tag which has amost centred the show but not quite. I'm not really sure what I'm doing, so some help would be appreciated.
Thanks in advance.

Wasn't sure how to put this in [code]

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script type="text/javascript" src="fadeslideshow.js">

/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>

<CENTER><script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [800, 600], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["1.jpg"],
["2.jpg"],
["3.jpg"],
["4.jpg"]
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:true},
persist: true, //remember last viewed slide and recall within same session?
fadeduration: 1500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})


</script>
<div id="fadeshow1"></div>


<br />

[code]




</head>

<body>



</body>
</html>

jscheuer1
10-27-2009, 02:35 AM
Let's see. The center tag has been deprecated. I know, it really doesn't make a lot of sense to me either, even though I understand the subtleties of why it wasn't really working out. To make matters 'worse', the way to center things now is to set their margin to margin: 0 auto; in the stylesheet.

And that's just the short answer. But I would try getting rid of the center tag and putting this in the head of your page:


<style type="text/css">
#fadeshow1 {
margin: 0 auto;
}
</style>

And if you don't already have a valid URL DOCTYPE as the very first thing in your page's source code, you will need that too. If that's a mystery to you, let me know, I think I can explain that as well.

But things would be easier in any case, if you want more help, if I had a link to your page, if so:

Please post a link to the page on your site that contains the problematic code so we can check it out.

jenphoto
10-27-2009, 03:15 AM
Thankyou very much John. I thought it would be something fairly simple but didn't know what.
And yes, the page does have a valid URL DOCTYPE as the first thing on the page.
In future, if I need more help, I will post a link.

Thanks again.
Jen