Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » Javascript not centered properly in a div


Javascript not centered properly in a div

Reply
  #1 (permalink)  
Old 11-14-03, 04:13 PM
Arowana Arowana is offline
Newbie Coder
 
Join Date: Oct 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript not centered properly in a div

Hi all,

Probably an easy one, but I can't seem to get it working. It WAS working, but darned if I know what happened...

http://www.bartlett-family.net/home.html

There is a scrolling marquee javascript at the top. It is centered perfectly in IE, but it is off to the left (next to the left-aligned div) in NS7 and Opera. Anyone know why? Thanks! It might be a css issue, but I can't figure out what the problem is. The css file is at:

http://www.bartlett-family.net/main.css

Oh, and I almost forgot... On that same page, in the middle, there is a link to the Macromedia website that I have set to open in a new browser window, using the "target="resource_window" attribute. That is not w3c compliant and is hindering my site from w3c validation. How can I get that link to open in a new browser window that IS w3c compliant? Thanks!

Chris
Reply With Quote
  #2 (permalink)  
Old 11-15-03, 01:53 AM
The Hooded's Avatar
The Hooded The Hooded is offline
Newbie Coder
 
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Here is a quick fix for your alginment problem.
Add the aligin="center" attribute to the div tag that needs to hold the script in the center.

Fix your link to macromedia by changing the anchor's target attribute to target="_blank" .

Hope this was some help.


Quote:
Originally Posted by Arowana
Hi all,

Probably an easy one, but I can't seem to get it working. It WAS working, but darned if I know what happened...

http://www.bartlett-family.net/home.html

There is a scrolling marquee javascript at the top. It is centered perfectly in IE, but it is off to the left (next to the left-aligned div) in NS7 and Opera. Anyone know why? Thanks! It might be a css issue, but I can't figure out what the problem is. The css file is at:

http://www.bartlett-family.net/main.css



Oh, and I almost forgot... On that same page, in the middle, there is a link to the Macromedia website that I have set to open in a new browser window, using the "target="resource_window" attribute. That is not w3c compliant and is hindering my site from w3c validation. How can I get that link to open in a new browser window that IS w3c compliant? Thanks!

Chris
__________________
The Hooded
Website Developing is my hobby
Reply With Quote
  #3 (permalink)  
Old 11-15-03, 05:51 AM
Arowana Arowana is offline
Newbie Coder
 
Join Date: Oct 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Add the aligin="center" attribute to the div tag that needs to hold the script in the center.
That only worked in Opera, not NS. BUT I did place a table inside the div and aligned the cell to center. THAT worked 100% and validated. Great, you got me moving in the right direction. Thanks!

The target="_blank doesn't change anything since the target attribute is what is causing the w3c errors, BUT adding a quick little javascript DOES fix it.
Code:
onclick="this.target='_blank';"
works great! Once again, thanks for a point in the right direction!

Chris

Last edited by Arowana; 11-15-03 at 06:45 AM.
Reply With Quote
  #4 (permalink)  
Old 11-15-03, 06:54 AM
Arowana Arowana is offline
Newbie Coder
 
Join Date: Oct 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
OOPS! Nevermind... That didn't work either. By adding the table, it works fine in NS and Opera now, but the script is misaligned in IE now! What's up?

Chris
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php and javascript together? gamextremer2003 PHP 5 11-06-03 02:18 PM
JavaScript Forum description; cosmetic. rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 7 10-06-03 04:45 PM
Javascript vs PHP, problem with arrays Chuff JavaScript 0 10-03-03 04:01 AM
Forcing a JavaScript to abort HiMyNameIs JavaScript 3 09-18-03 10:23 AM
Looking for a free javascript menu spiggy JavaScript 2 06-18-03 05:58 AM


All times are GMT -5. The time now is 08:55 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.