Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



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

Posts: 60
Name: tami
Trades: 0
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
 
 
Register now for full access!
Old 08-22-2007, 05:23 PM Re: Doctype Html Public
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
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.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-22-2007, 05:29 PM Re: Doctype Html Public
Skilled Talker

Posts: 60
Name: tami
Trades: 0
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
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





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



Page generated in 0.20977 seconds with 12 queries