Forum Index
SUBSIM Forum Search

The Web's #1 BBS for all submarine and naval simulations!
[ SUBSIM Review ] [ SUBSIM STORE ]
Current Forum | Archives 2002-2003 |

HTML Question
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> General Topics
View previous topic :: View next topic  
Author Message
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Mon Jan 03, 2005 10:56 pm    Post subject: HTML Question Reply with quote

I am making my new site and I am using a frame.

Just two,

A Menu on the left and the main screen on the right.

I have a thin border separating the frames but I want to lock the border so it doesn't move.

What code do I need to do this?

This is the code for my index page

Code:
<head>
<title>XabbaRus's Sub Command 3D Models</title>
</head>




<!----Left hand Frame Menu--------------------->
<frameset cols = "15%,*" border = img src = "./Buttons/Home.png">

   <frame name="menu" src ="http://homepages.tesco.net/benedict.kent/menu.html" scrolling = "NO">

<!------Right hand frames---------------------->

    
      <frame name="main" src="http://homepages.tesco.net/benedict.kent/main.html" scrolling = "YES">

        </frameset>
   
</frameset>


</body>
</html>
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Neal Stevens



Joined: 25 Jan 1997
Posts: 3517
Location: Houston, Texas

PostPosted: Tue Jan 04, 2005 1:09 am    Post subject: Reply with quote

If a frame has visible borders, the user can resize it by dragging the border. To prevent a user from doing this, you can add noresize="noresize" to the <frame> tag.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Tue Jan 04, 2005 11:02 am    Post subject: Reply with quote

Cheers Neal....


Will do that
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Tue Jan 04, 2005 11:53 am    Post subject: Reply with quote

OK more help

This is to do with Javascript and

I am making a gallery where clicking on the small image will open a window with the larger image.

I did this on my previous site and it works.

This is the code from Shkvalru site.

Code:

<html>
<head>
<script language = "JavaScript">
<!--
function newpic (page, pagename, description, x, y)
   {
newWindow=window.open ('',pagename,'width = '+x+',height = '+y+', menubar = 0, scrollbars = 0, locationbar = 0, directories = 0, resizable = 1, statusba = 0, toolbar = 0')

newWindow.document.write ('<html><head><title>' + description + '</title></head>')

newWindow.document.write ('<body height = leftmargin = "0" topmargin = "0" marginwidth = "0" marginheight = "0" bgcolor="#000000">')

newWindow.document.write ('<img src = '+ page +'>');
newWindow.document.write ('</p></body></html>');
   }
//-->
</script>

</head>
<body bgcolor = black text = #bebebe link = #bebebe vlink = red>



<pre>
</pre>

<br>

<table align = center width = "600" border="0" cellspacing="0" cellpadding="0">



<tr>

    <td width = "150"><a href = "javascript:newpic ('../shkvalru/images/Type45b.jpg','Type45','Type 45
Destroyer',800,600)""><img src = "../shkvalru/images/Type45bThumb.jpg" border = 0 alt = "Type 45 Destroyer"></a></td>


This is the code from my new site

Code:
<html>
<head>
<script language = "JavaScript">
<!--
function newpic (page, pagename, description, x, y)
   {
newWindow=window.open ('',pagename,'width = '+x+',height = '+y+', menubar = 0, scrollbars = 0, locationbar = 0, directories = 0, resizable = 1, statusba = 0, toolbar = 0')

newWindow.document.write ('<html><head><title>' + description + '</title></head>')

newWindow.document.write ('<body height = leftmargin = "0" topmargin = "0" marginwidth = "0" marginheight = "0" bgcolor="#000000">')

newWindow.document.write ('<img src = '+ page +'>');
newWindow.document.write ('</p></body></html>');
   }
//-->
</script>

</head>

<body bgcolor="gray" text="black" link="white" vlink="#27E727" alink="yellow">

<p style ="font-family:courier">
<b><u>Amphibious Assault Ships</u></b>
</p>

<table align = left width = "250" border="0" cellspacing="0" cellpadding="0">



<tr>

<td><a href = "javascript:newpic ('./Images/Albion.jpg','Albion Class LPD','Albion Class LPD',800,600)""><img src = "./Images/AlbionLo.jpg" border = 0 alt = "Albion Class LPD"></a></td>


<td><a href = "javascript:newpic ('./Images/Albion_R.jpg','Albion Class LPD','Albion Class LPD',800,600)""><img src = "./Images/Albion_RLo.jpg" border = 0 alt = "Albion Class LPD"></a></td>


</tr>

</table>








</body>
</head>
</html>


Now as you can see I copied and pasted the code from Shkvalru into my new site and modified it and it doesn't work now.

My new site is http://homepages.tesco.net/benedict.kent

Please help me out as I am sure it is coding error rather than my system. I think I must have altered something by mistake.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Tue Jan 04, 2005 5:26 pm    Post subject: Reply with quote

Strange thing is the JavaScript works in Mozilla Firefox but not IE6

huh??

My shkvalru site works fine in IE6 and Firefox.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Jesper



Joined: 14 Sep 2002
Posts: 2063
Location: Denmark (GMT+01.00)

PostPosted: Tue Jan 04, 2005 6:09 pm    Post subject: Reply with quote

Start with :

Code:
<script type="text/javascript">

and not
Code:
<script language = "JavaScript">

So that you write your scripts accordingly to the HTML standards Smile

Why it works in FF and not in IE, Im not really sure about, its usually the other way around.


You might wanna get used to run your websites thru a HTML validator, W3.org has a superb one. Smile
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Tue Jan 04, 2005 6:58 pm    Post subject: Reply with quote

Cheers Jesper.

I was looking for one of those.

Also I am trying to put a table UNDER another table on the same page but it keeps ending up next to the first table.

Any ideas?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Jesper



Joined: 14 Sep 2002
Posts: 2063
Location: Denmark (GMT+01.00)

PostPosted: Tue Jan 04, 2005 9:10 pm    Post subject: Reply with quote

make use of the H*W codes.. eg:

Code:
<table height="40%" width="100%">
 <tr><td>This is my 1st table it uses 40% of my screen  from where it starts in the code and downwards</td></tr>
</table>

<br />
adding 2 line breaks above this text and below
<br />

<table height="20%" width="100%">
<tr><td>This is my 2nd table it uses 20% of my screen from where it starts in the code and downwards</td></tr>
</table>


Note that the H/W values doesnt have to be % you can also use H="320" W="800" (pixles)

Or simply add the tables in the same table:

Code:
<table>
 <tr>
  <td> Top table</td>
 </tr>
 <tr>
  <td> <table> <tr> <td> This is the bottom table</td> </tr> </table> </td>
 </tr>
</table>


Or both inside a main table:

Code:
<table>
 <tr>
  <td> <table> <tr> <td> This is the top table</td> </tr> </table> </td>
 </tr>
 <tr>
  <td> <table> <tr> <td> This is the bottom table</td> </tr> </table> </td>
 </tr>
</table>
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Iceman



Joined: 14 Sep 2002
Posts: 1077
Location: Mesa Arizona

PostPosted: Wed Jan 05, 2005 2:41 am    Post subject: Reply with quote

This is a site I use/used when I first began web pages. Joking

www.webmonkey.com
Back to top
View user's profile Send private message
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Wed Jan 05, 2005 1:48 pm    Post subject: Reply with quote

Hm I tried the second variant and the table still comes up next to the first one not below.....

I am wanting seperate tables.

The reason being is that I want it to look like this.

Amphibious Assault Ships

Table with thumbnails of ships.

Surface Comabatants

Table with thumbnails of ships

So on and so on.

Maybe I should post my whole code as I have it right now.

Code:
<html>
<head>
<script type = "text/JavaScript">
<!--
function newpic (page, pagename, description, x, y)
   {
newWindow=window.open ('',pagename,'width = '+x+',height = '+y+', menubar = 0, scrollbars = 0, locationbar = 0, directories =

0, resizable = 1, statusba = 0, toolbar = 0')

newWindow.document.write ('<html><head><title>' + description + '</title></head>')

newWindow.document.write ('<body height = leftmargin = "0" topmargin = "0" marginwidth = "0" marginheight = "0"

bgcolor="#000000">')

newWindow.document.write ('<img src = '+ page +'>');
newWindow.document.write ('</p></body></html>');
   }
//-->
</script>

</head>

<body bgcolor="gray" text="black" link="white" vlink="#27E727" alink="yellow" style = "font-family:courier">



<table align = left width = "230" border="1" cellspacing="0" cellpadding="0">

   <p>
      <b><u>Amphibious Assault Ships</u></b>
   </p>

   <tr>
        <td width = "110"><a href = "javascript:newpic ('./Images/Albion.jpg','Albion Class LPD','Albion Class

LPD',800,600)""><img src = "./Images/AlbionLo.jpg" border = 0 alt = "Albion Class LPD"></a><!----/td>

              <!-----td><a href = "javascript:newpic ('./Images/Albion_R.jpg','Albion Class LPD','Albion Class    

LPD',800,600)""><img src = "./Images/Albion_RLo.jpg" border = 0 alt = "Albion Class LPD"></a></td>

   <!----td width = "50"></td>

            <td width = "110"><a href = "javascript:newpic ('./Images/BiP.jpg','BiP LPD','BiP LPD',800,600)""><img           

             src = "./Images/BiPLo.jpg" border = 0 alt = "BiP LPD"></a><!-----/td>

            <!-----td><a href = "javascript:newpic ('./Images/BiP_R.jpg','BiP LPD','BiP LPD',800,600)""><img src =           

             "./Images/BiP_RLo.jpg" border = 0 alt = "BiP LPD"></a></td>


   </tr>

  <tr>
      <td valign = top>Albion Class LPD</td> 
            
      <td valign = top>BiP LPD</td>
  </tr>
</table>


</body>
</head>
</html>


Also changing the Javascript bit from language to type doesn't change anything...Sad
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Jesper



Joined: 14 Sep 2002
Posts: 2063
Location: Denmark (GMT+01.00)

PostPosted: Wed Jan 05, 2005 3:48 pm    Post subject: Reply with quote

first you need to define your webpage:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>My Page</title>
 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>

Change the title to reflect your page name.

Now for your html body:

Code:
<body bgcolor="gray" text="black" link="white" vlink="#27E727" alink="yellow" style="font-family:courier">
<!-- insert your javascript here -->


And your tables:
Code:
<table>
 <tr>
  <td>
   <table align="left" width="230" border="1">
    <tr>
     <td width="110">This is your First Table Named : Amphibious Assault Ships :</td>
     <td width="110">This is your First Table Named : Amphibious Assault Ships :</td>
    </tr>
    <tr>
     <td width="110">This is your First Table Named : Amphibious Assault Ships :</td>
     <td width="110">This is your First Table Named : Amphibious Assault Ships :</td>
    </tr>
   </table>
  </td>
 </tr>
  <br /><br />
 <tr>
  <td>
   <table align="left" width="230" border="1">
    <tr>
     <td width="110">This is your Second Table Named : Surface Comabatants  :</td>
     <td width="110">This is your Second Table Named : Surface Comabatants  :</td>
    </tr>
    <tr>
     <td width="110">This is your Second Table Named : Surface Comabatants  :</td>
     <td width="110">This is your Second Table Named : Surface Comabatants  :</td>
    </tr>
   </table>
  </td>
 </tr>
</table>


And the end of the document
Code:
</body>
</html>
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Jesper



Joined: 14 Sep 2002
Posts: 2063
Location: Denmark (GMT+01.00)

PostPosted: Wed Jan 05, 2005 3:59 pm    Post subject: Reply with quote

Quote:
Also changing the Javascript bit from language to type doesn't change anything..

Right it doesnt change anything that you see, but it makes make your html compatible with the HTML RFC.
which also allows browsers that isnt tweaked and hacked with all sorts of non standard html checks Smile

also remember to use code="value" no spaces and both "" are required Smile
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Wed Jan 05, 2005 5:34 pm    Post subject: Reply with quote

But Jesper

That Javascript code was ripped from another site I made and it works just fine in that site.


Also I was using the w3c validator and put in a the doctype for 4.01 and it tells me HTML isn't allowed and that my
Code:
<html>
tag isn't allowed.


huh?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Wed Jan 05, 2005 5:55 pm    Post subject: Reply with quote

Ok getting there with the validator.

Some things still seem odd though.

I am using frames so used frameset document type.

seems that border and src aren't allowed but it is my commas coming up in red.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
XabbaRus



Joined: 21 Sep 2001
Posts: 6949

PostPosted: Wed Jan 05, 2005 6:25 pm    Post subject: Reply with quote

Cheers Jesper, my gallery looks better though the Javascript just ain't working.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> General Topics All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group