Reply
Doctype Html Public
Old 08-22-2007, 04:59 PM Doctype Html Public
Skilled Talker

Posts: 59
Name: tami
i have a script for an album in javascript. i am using<img id="pic"> as the container for the pictures. i found out that in Mozila it works only if i take out of the DOCTYPE HTML PUBLIC, at the top of the page,this:
HTML Code:
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
the problem is that when i do this, in ie my center div is not in the center.
i used:margin:0 auto;
what can i do make it work in both browzers?
pizza is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-22-2007, 05:23 PM Re: Doctype Html Public
tripy's Avatar
Fetchez la vache!

Posts: 2,171
Name: Thierry
Location: In the void
In any case, let the doctype in your document, it triggers the strict mode in the browsers, and removing it let IE switch to quirks mode.
The quirks mode affect the css rendering, and that's the reason your design change.

The problem is most likely in your javascript.
Post it there or give the url, so we can check it out.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 08-22-2007, 05:29 PM Re: Doctype Html Public
Skilled Talker

Posts: 59
Name: tami
the code is:
HTML Code:
var images=new Array(11);
//creates an array that will include the photos,the number indicates the number of photos.
var loc=0;
//creates a vaeiable that will indicate the number of the photo being showen.
function LoadPhotos()
 {
  for (i=0;i<images.length;i++)
   {
   images[i]=new Image();
   images[i].src="picts/an"+(i+1)+".jpg"
   }
 }
//a loop function that loades the photos. 
function NextPhoto()
 {
  loc++
  if (loc>=images.length)
    {
    loc=0;
    }
  ShowPhoto(images[loc].src); 
 }
//the loc++ adds 1 number to the loc which happens each time you press next.
//an if sentance that tells me that if the location is bigger than the number of photos then you go to the first one.
//calls a function (showPhoto)that displays the correct photo.   
   function PreviousPhoto()
 {
  loc--;
  if (loc<0)
  {
   loc=images.length-1;
  }
  ShowPhoto (images[loc].src);
 }
 //works the same idea as the next function.
  function ShowPhoto (filename)
 {
  pic.src=filename;
  pic.alt="Filename: "+filename;
  window.status=filename;
 }
 //displays the photos
 LoadPhotos();
and in the body tag i have this:
HTML Code:
onLoad="ShowPhoto (images[0].src)"
pizza is offline
Reply With Quote
View Public Profile
 
Old 08-22-2007, 07:01 PM Re: Doctype Html Public
Novice Talker

Posts: 9
Name: Sebastian
I don't understand, let me check the code
TeppaHosting is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Doctype Html Public
 

Thread Tools

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

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


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11884 seconds with 12 queries