Log in

View Full Version : Center align within Javascript



Lost
08-27-2007, 07:40 AM
1) Script Title: Left-Right Image show

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

3) Describe problem:
Hi All,

I have successfully run the Left-Right Image Show within our 3rd party application we use as our intranet. This 3rd party application is run on asp pages which we are not allowed to change. The left-right image show has been perfect as the only place I am able to insert script is within the <body> tags.

My dilema is that the Show is Left aligned. I have tried adding the align option within <td></td> tags and also using '<div id="main2" style="position:relative;align:center;... both to no avail. The <td> throws the page out completely (being that the <tr> is assigned via the asp page).

Is there any way the align function can be used within this javascript???

Thanks.

jscheuer1
08-27-2007, 01:43 PM
This may work:


<div style="text-align:center;">
<div style="width:100px;text-align:left;">
slide show
</div></div>

Note: the width of the inner division should be the width of the slide show.

With a page in standards mode, you can do this:


<div style="width:100px;margin:0 auto;">
slide show
</div>

But, from the way you described the situation, you may have no control over the mode of the page.

Lost
08-27-2007, 11:26 PM
It's worked brilliantly! Thank you so much John.

I'm off to find out how to 'click to enlarge'.

Thanks again.

Lost
08-28-2007, 06:11 AM
Hi Again,

Well, after spending all day (AEST) trying to figure out how to create an enlarged image pop-up, again I am Lost. Obviously I can set it to link to target=_blank and have it display on another page however I really would like either a mouseover or click to enlarge and have it display on the same page.

If anyone knows how this can be done just by using the <body> section that would be wonderful. If not, thanks for taking the time to read this.

Cheers.