Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts

    W3C validation problems

    Hi!

    When I validate my page: direct link to validator I get ie this error:

    Error Line 20 column 47: document type does not allow element "a" here.
    menu1[1]='<a href="http://www.freewarejava.com">Browse Files</a>'
    This is my code for the following error:

    menu1[0]='<a href="http://www.javascriptkit.com">New Files</a>'
    What should I write there instead of a? As far as I know it won't work without the "a"..?
    ------------------------------
    Also I get following error:

    Warning Line 96 column 20: character "&" is the first character of a delimiter but occurred as data.
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
    This is my code for the following error:

    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")

    If I remove 1 of the "&" I get an error too. But if they arn't there my script dosn't work. What should I do?
    ------------------------------
    One error more I get is this:

    Error Line 184 column 934: duplicate specification of attribute "onmouseover".
    ... event, menu3, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Gal
    This is my code for the following error:

    <img src="knapper/Gallery.gif" alt="Gallery" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu4, '165px')" onmouseover="delayhidemenu()"/>
    I have several of the following lines, as there are more buttons. But I need to write the tag to every button or it won't work. What do I do?

    Cheers!

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    put all the JS functions you want to run in one onmouseover attribute, and separate them with semicolons:

    <img src="knapper/Gallery.gif" alt="Gallery" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu4, '165px');delayhidemenu()" />

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Hmm...When I replace it with the code you provided the menu won't stay out (it's a drop-out menu), but dissapears in 1 sec or less, even though I have the mouse over the button.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Just move your JS to an external file and call it using
    Code:
    <script type="text/javascript" src="urltoexternalfile.js"></script>
    And when using an xhtml doctype you need to close all tags. However an image tag has no closing tag so you need to self close it.

    This is correct
    Code:
    <img src="blah.jpg" alt="" />
    This is not
    Code:
    <img src="blah.jpg" alt="">
    You could also use the second method if you were using an HTML doctype.
    Last edited by _Aerospace_Eng_; 07-03-2007 at 03:47 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Thanks, that corrected a whole bunch of errors

    About the javascript file, should I just put all my scripts in it? How would I then link to each of the different scripts? Like how would I come around this:

    <div id="clock">
    <script language="JavaScript">
    function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinute s(),tN().getUTCSeconds()); x.setTime(x.getTime()); return x; }
    function tN(){ return new Date(); }
    function lZ(x){ return (x>9)?x:'0'+x; }
    function dE(x){ if(x==1||x==21||x==31){ return 'st'; } if(x==2||x==22){ return 'nd'; } if(x==3||x==23){ return 'rd'; } return 'th'; }
    function dT(){ if(fr==0){ fr=1; document.write('<font size="2" face="tahoma" color="#D6D5D5"><b><span id="tP">'+eval(oT)+'</span></b></font>'); } document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); }
    var mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),fr=0,oT="tS().getDate ()+dE(tS().getDate())+' '+mN[tS().getMonth()]+' '+' '+lZ(tS().getHours())+':'+lZ(tS().getMinutes())+' '+'Z'+'u'+'l'+'u'";
    </script>
    <script language="JavaScript">dT();</script>
    </div>
    What should I put in the DIV to display the clock then?

  • #6
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    You would just reference them as your would normally...just place this in between the <head> tags

    Code:
    <script type="text/javascript" src="scripts/js/filename.js"></script>

    Then just call them normally:

    Code:
    <script type="text/javascript">dT();</script>
    The function in the div calls the functions, all you have to do is this:

    Code:
    <div><script type="text/javascript">dT();</script></div>
    Last edited by BWiz; 07-04-2007 at 05:26 PM. Reason: typo
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #7
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    First, does the file have to be located in scripts/js/filename.js ?

    Because now I have put ALL my scripts in a file called "javascripts.js" located in the same folder as my website and it's files.

    However when I include the sentence:

    <script type="text/javascript" src="javascripts.js"></script>
    between the <head> and </head> tags and then place this code:

    <script type="text/javascript">dT();</script>
    between my <div id="clock"></div> nothing happens..Also my dropout-menu dosn't work. What have I done wrong?

  • #8
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Hmm, odd, can you show your code?
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #9
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Sure

    Here goes the main page:

    Code:
    <?php include("lp_source.php"); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Home - XflightX - You are cleared to land...</title>
    <link href="teststyle.css" rel="stylesheet" type="text/css" />
    <link href="calendar/style.css" rel="stylesheet" type="text/css"  />
    <script type="text/javascript" src="javascripts.js"></script>
    
    
    </head>
    
    <body>
    <div id="container">
    <!-- MENU -->
      <div id="header"><img src="NEW2.jpg" alt="XflightX Banner" width="981" /></div>
      <div id="content">
      <div id="infoleft">
      <div id="uppermenu"></div>
      <div id="menu"><img src="knapper/Home.gif" alt="Home" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" /><img src="knapper/Downloads.gif" alt="Downloads" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu1, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Guestbook.gif" alt="Guestbook" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu2, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/FlightClub.gif" alt="Flight Club" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu3, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Gallery.gif" alt="Gallery" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu4, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Forums.gif" alt="Forums" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu5, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Contact.gif" alt="Contact" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu6, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Links.gif" alt="Links" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu7, '168px')" onmouseover="delayhidemenu()"/><img src="knapper/KnowledgeBase.gif" alt="Knowledge Base" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu8, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Design.gif" alt="Design" style="border-top-width:1px; border-bottom-width:1px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu9, '165px')" onmouseover="delayhidemenu()"/></div><div id="lowermenu">
    </div>
    <!-- MENU END -->
    <!--CALENDAR -->
      <div id="calender"><h1>Calendar</h1>
      <?php include('calendar/calendar.php');
    $calendar = new WingedCalendar();
    
    // to display a single calendar
    $calendar->show_calendar();
    
    // where PREVIOUS and NEXT are the number of months
    // before and after the current month respectively.  
    ?><h2><b>Feel free to add things</b></h2>
    </div>
    <!-- CALENDAR END -->
    <!-- LEFT SIDE BOXES -->
    <div id="box_partners"><h1>Partners</h1><a href="http://www.freedomain.co.nr/" target="_blank"><img src="partners/co.nr.gif" alt="co.nr domains" width="150" height="30" border="0" /></a>
    <a href="http://www.mysafetycards.piczo.com" target="_blank"><img src="partners/mysafetycards.gif" alt="Mysafetycards" width="150" height="30" border="0" /></a>
    <a href="http://www.worldwidetopsites.com/php/in.php?id=Kasio" target="_blank"><img src="partners/topsitesvote.gif" alt="Vote for XflightX" width="150" height="30" border="0" /></a></div>
      </div>
      <div id="main">
      
    <center><?PHP
    $number=5;
    include("/home/sites/port10.com/public_html/xflightx/test/cutenews/show_news.php");
    ?>
    <a href="cutenews/search.php" target="_blank">Search news</a></center>
    </div>
    <!-- LEFT SIDE BOXES END -->
    <div id="inforight">
    <!-- CLOCK -->
    <div id="clock">
    <script type="text/javascript">dT();</script>
    </div>
    <!-- CLOCK END -->
    <!-- RIGHT SIDE BOXES -->
    <div id="box_welcome"><h1>Welcome</h1>
    <h2>Hi and welcome to <b>XflightX!</b>
      <br />
      The site has now got an "extreme makeover", so feel free to browse around and see what's new!
    Enjoy your stay and please feel free to <br /><a href="contact.php">contact me</a><br /> if you have any queries.</h2>
    	</div>
    <!-- WEATHER -->
    <div id="weather"><h1>Weather</h1><div id="paddingdiv">
    <form name="frm" method="post" action="http://adds.aviationweather.noaa.gov/metars/index.php" target="popup" onsubmit="return createPopup(this.target);">
    <input size="14" name="station_ids" type="text" style="font-size: 8pt; font-family: Arial" value="Enter ICAO" />
    				<br />
    <input type="radio" name="std_trans" value="standard" checked=""/> Raw Format
    				<br />
    <input type="radio" name="std_trans" value="translated"/> Translated
    				<br />
    <input type="checkbox" name="chk_metars" checked/> METARs   
    <input type="checkbox" name="chk_tafs"/> TAFs
    				<br />
                    <select name="hoursStr">
                      <option selected> most recent only</option>
                      <option>          past 1 hours</option>
                      <option>          past 2 hours</option>
                      <option>          past 3 hours</option>
                      <option>          past 4 hours</option>
                      <option>          past 5 hours</option>
                      <option>          past 6 hours</option>
                      <option>          past 12 hours</option>
                      <option>          past 18 hours</option>
                      <option>          past 24 hours</option>
                      <option>          past 36 hours</option>
                    </select>
    				<br />
    				<br />
    
    <input name="btnSubmit" style="font-size: 8pt; font-family: Arial" type="submit" value="Submit" />
    <input type="reset" style="font-size: 8pt; font-family: Arial" value="Reset Form" />
    </form></div></div>  
    <!-- WEATHER END -->
    <!-- FORUM TOPICS BEGIN -->
    <div id="box_poll"><h1>Poll</h1>
    <div id="paddingdiv1"><h2><?php echo($question); ?>
    <br />
    <?php if($votingstep==1) { echo($step1str); } 
          if($votingstep==2) { echo($step2str); } 
          if($votingstep==3) { echo($step3str); }?>
    Total votes: <?php echo($totalvotes); ?></h2></div>
    </div>
    <!-- FORUM TOPICS END -->
    </div>
    <!-- RIGHT SIDE BOXES END -->
    </div>
    <div id="footer"><h3> 2007 - XflightX | All Rights Reserved</h3></div>  
    </div>
    
    
    
    
    
    </body>
    </html>
    Stylesheet:

    Code:
    /*DO NOT CHANGE - MAIN LAYOUT BEGIN*/
    body { 				background-color:#333333;
    	   		    	margin-top:0px;
    	   				margin-left:auto;
    	   				margin-right:auto;
    					}
    
    #container { 
       					width:981px;
       					margin-left:auto;
       					margin-right:auto;
    					border-style:solid;
    					border-width:1px;
    					border-color:#000000;
    					}
    					
    #header {
     					float:left;
     					}
    					
    #inforight {
      					width: 150px;
      					float: left;
      					margin-left:5px;
      					margin-top:10px;
    					}
    					
    #main {
      					background-color:#666666;
    					width: 655px;
     					float: left;
     					margin-top:10px;
      					border-style:solid;
      					border-width:1px;
      					border-color:#000000;
    					padding:5px;
    					text-align:center;
    					}
    
    #infoleft {
       					width:150px;
       					float:left;
       					margin-right:5px;
       					margin-top:10px;
    					}
    					
    					
    #footer {			background-image:url("Footer.gif");
    					float:left;
    					width:981px;
    					height:63px;
    					}
    					
    					
    h1 { 				width:150px;
    					font-family:Arial;
    					font-weight:bold;
    					font-size:12px;
    					color:#FFFFFF;
    					background-color:#000000;
    					text-align:center;
    					margin:0px;
    					padding:0px;
    					}	
    				
    				
    h2 {				font-family:Arial;
    					font-weight:normal;
    					font-size:12px;
    					color:#000000;
    					text-align:center;
    					padding-left:5px;
    					padding-right:5px;
    					padding-top:0px;
    					pading-bottom:1px;
    					margin-top:0px;
    					margin-bottom:0px;
    					}		
    					
    					
    h3 {				font-family:arial;
    					font-size:10px;
    					text-align:center;
    					font-weight:bold;
    					margin-top:31px;
    					}		
    
    
    
    a {					color:#FFFFFF;
    					text-decoration:none;
    					}
    				
    
    #uppermenu {	   	background-color:#C8C8C8;
    					width:150px;
    					height:10px;
    					border-style:ridge;
    					border-width:1px;
    					font-size:1px;
    					}
    					
    					
    #lowermenu {	   	background-color:#C8C8C8;
    					width:150px;
    					height:10px;
    					border-style:ridge;
    					border-width:1px;
    					font-size:1px;
    					}
    					
    					
    #menu {				margin-left:5px;
    					height:100%;
    
    					}
    					
    					
    #dropmenudiv{
    					position:absolute;
    					background-color: #000000;
    					border:1px solid black;
    					border-bottom-width: 0;
    					font:normal 12px Arial;
    					line-height:18px;
    					z-index:100;
    					filter:alpha(opacity=70);
    					-moz-opacity:.70;
    					opacity:.70;
     
    					}
    					
    					
    #dropmenudiv a{
    					width: 100%;
    					display: block;
    					text-indent: 3px;
    					border-bottom: 1px solid black;
    					padding: 1px 0;
    					text-decoration: none;
    					font-weight: bold;
    					color:#FFFFFF;
    					}
    
    
    #dropmenudiv a:hover{ /*hover background color*/
    					background-color: #979797;
    					}
    
    
    #calender {			background-image:url("box_bg.gif");
    					width:150px;
    					margin-top:10px;
    					margin-bottom:0px;
    					border-width:1px;
    					border-left-width:0px;
    					border-style:solid;
    					border-color:#000000;
    					}
    				
    					
    #clock {			background-image:url("box_bg.gif");
    					width:150px;
    					border-width:1px;
    					border-style:solid;
    					border-color:#000000;
    					margin-bottom:10px;
    					text-align:center;
    					}
    					
    				
    #weather {			background-image:url("box_bg.gif");
    					width:150px;
    					font-family:arial;
    					font-size:8pt;
    					color:#000000;
    					margin-bottom:10px;
    					border-width:1px;
    					border-style:solid;
    					border-color:#000000;
    					}	
    					
    					
    #paddingdiv {		padding-left:8px;
    					}	
    					
    #paddingdiv1 {		padding-top:2px;
    					padding-right:3px;
    					padding-left:3px;
    					}		
    /*DO NOT CHANGE - MAIN LAYOUT END*/
    /*CONTENT LEFT SIDE BEGIN*/
    #box_partners {		background-image:url("box_bg.gif");
    					width:150px;
    					margin-top:10px;
    					margin-bottom:0px;
    					text-align:center;
    					border-width:1px;
    					border-left-width:0px;
    					border-style:solid;
    					border-color:#000000;
    	   				}
    /*CONTENT LEFT SIDE END*/
    /*CONTENT RIGHT SIDE BEGIN*/   
    
    
    
    #box_welcome {			background-image:url("box_bg.gif");
    					width:150px;
    					margin-bottom:10px;
    					border-width:1px;
    					border-style:solid;
    					border-color:#000000;
    					}
    					
    					
    #box_poll {			background-image:url("box_bg.gif");
    					width:150px;
    					margin-bottom:10px;
    					border-width:1px;
    					border-style:solid;
    					border-color:#000000;
    					}
    
    
    					
    /*CONTENT RIGHT SIDE END*/
    And the javascripts.js file:

    Code:
    <script type="javascript">
    function createPopup(popupName){
      var w = window.open("", popupName, "width=600,height=500,toolbar=no,location=no,statusbar=no,menubar=no,resizable=no");
      w.focus();
      return true;
    }
    </script>
    
    <script type="text/javascript">
    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="http://www.javascriptkit.com">New Files</a>'
    menu1[1]='<a href="http://www.freewarejava.com">Browse Files</a>'
    menu1[2]='<a href="http://codingforums.com">Search Files</a>'
    
    //Contents for menu 2, and so on
    var menu2=new Array()
    menu2[0]='<a href="http://www.javascriptkit.com/cutpastejava.shtml">Add Comment</a>'
    menu2[1]='<a href="http://www.javascriptkit.com/javaindex.shtml">View Guestbook</a>'
    
    var menu3=new Array()
    menu3[0]='<a href="http://www.javascriptkit.com/cutpastejava.shtml">Join Flight Club</a>'
    menu3[1]='<a href="http://www.javascriptkit.com/javaindex.shtml">Pilot Login</a>'
    menu3[2]='<a href="http://www.javascriptkit.com/javaindex.shtml">ATC Login</a>'
    menu3[3]='<a href="http://www.javascriptkit.com/javaindex.shtml">Route Table</a>'
    menu3[4]='<a href="http://www.javascriptkit.com/javaindex.shtml">Route Planner</a>'
    menu3[5]='<a href="http://www.javascriptkit.com/javaindex.shtml">Fleet</a>'
    menu3[6]='<a href="http://www.javascriptkit.com/javaindex.shtml">Rank System</a>'
    menu3[7]='<a href="http://www.javascriptkit.com/javaindex.shtml">Request Training</a>'
    
    var menu4=new Array()
    menu4[0]='<a href="http://www.javascriptkit.com">Movies</a>'
    menu4[1]='<a href="http://www.javascriptkit.com">Webcams</a>'
    menu4[2]='<a href="http://www.javascriptkit.com">Live ATC</a>'
    menu4[3]='<a href="http://www.javascriptkit.com">Wallpapers</a>'
    menu4[4]='<a href="http://www.javascriptkit.com">Reviews</a>'
    
    var menu5=new Array()
    menu5[0]='<a href="http://www.javascriptkit.com">Forums</a>'
    
    var menu6=new Array()
    menu6[0]='<a href="http://www.javascriptkit.com">Contact</a>'
    menu6[1]='<a href="http://www.javascriptkit.com">Submit News</a>'
    
    var menu7=new Array()
    menu7[0]='<a href="http://www.javascriptkit.com">Flightsim</a>'
    menu7[1]='<a href="http://www.javascriptkit.com">Real Aviation</a>'
    menu7[2]='<a href="http://www.javascriptkit.com">Virtual Airlines</a>'
    menu7[3]='<a href="http://www.javascriptkit.com">Freeware Add-on Developers</a>'
    menu7[4]='<a href="http://www.javascriptkit.com">Payware Add-on Developers</a>'
    menu7[5]='<a href="http://www.javascriptkit.com">Link to Us</a>'
    
    var menu8=new Array()
    menu8[0]='<a href="http://www.javascriptkit.com">Flight Simulator History</a>'
    menu8[1]='<a href="http://www.javascriptkit.com">Frequently used Words</a>'
    menu8[2]='<a href="http://www.javascriptkit.com">Divirse Tutorials</a>'
    
    var menu9=new Array()
    menu9[0]='<a href="http://www.javascriptkit.com">Graphic Design</a>'
    menu9[1]='<a href="http://www.javascriptkit.com">Web Design</a>'
    menu9[2]='<a href="http://www.javascriptkit.com">Other</a>'
    
    
    		
    var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
    var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)
    
    /////No further editting needed
    var ie4=document.all
    var ns6=document.getElementById&!document.all
    
    if (ie4||ns6)
    document.write('<div id="dropmenudiv" style="visibility:hidden;width: 160px" onmouseover="clearhidemenu()" onmouseout="dynamichide(event)"></div>')
    
    function getposOffset(what, offsettype){
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
    }
    return totaloffset;
    }
    function showhide(obj, e, visible, hidden, menuwidth){
    if (ie4||ns6)
    dropmenuobj.style.left=dropmenuobj.style.top=-500
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width=menuwidth
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
    obj.visibility=visible
    else if (e.type=="click")
    obj.visibility=hidden
    }
    function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }
    function clearbrowseredge(obj, whichedge){
    var edgeoffset=0
    if (whichedge=="rightedge"){
    var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
    }
    else{
    var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
    var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
    edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
    if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
    edgeoffset=dropmenuobj.y
    }
    }
    return edgeoffset
    }
    function populatemenu(what){
    if (ie4||ns6)
    dropmenuobj.innerHTML=what.join("")
    }
    function dropdownmenu(obj, e, menucontents, menuwidth){
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    clearhidemenu()
    dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
    populatemenu(menucontents)
    if (ie4||ns6){
    showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
    dropmenuobj.x=getposOffset(obj, "left")
    dropmenuobj.y=getposOffset(obj, "top")
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
    }
    return clickreturnvalue()
    }
    function clickreturnvalue(){
    if (ie4||ns6) return false
    else return true
    }
    function contains_ns6(a, b) {
    while (b.parentNode)
    if ((b = b.parentNode) == a)
    return true;
    return false;
    }
    function dynamichide(e){
    if (ie4&&!dropmenuobj.contains(e.toElement))
    delayhidemenu()
    else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
    delayhidemenu()
    }
    function hidemenu(e){
    if (typeof dropmenuobj!="undefined"){
    if (ie4||ns6)
    dropmenuobj.style.visibility="hidden"
    }
    }
    function delayhidemenu(){
    if (ie4||ns6)
    delayhide=setTimeout("hidemenu()",disappeardelay)
    }
    function clearhidemenu(){
    if (typeof delayhide!="undefined")
    clearTimeout(delayhide)
    }
    </script>
    
    <script language="JavaScript">
    function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinutes(),tN().getUTCSeconds()); x.setTime(x.getTime()); return x; } 
    function tN(){ return new Date(); } 
    function lZ(x){ return (x>9)?x:'0'+x; } 
    function dE(x){ if(x==1||x==21||x==31){ return 'st'; } if(x==2||x==22){ return 'nd'; } if(x==3||x==23){ return 'rd'; } return 'th'; } 
    function dT(){ if(fr==0){ fr=1; document.write('<font size="2" face="tahoma" color="#D6D5D5"><b><span id="tP">'+eval(oT)+'</span></b></font>'); } document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } 
    var mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),fr=0,oT="tS().getDate()+dE(tS().getDate())+' '+mN[tS().getMonth()]+' '+' '+lZ(tS().getHours())+':'+lZ(tS().getMinutes())+' '+'Z'+'u'+'l'+'u'";
    </script>
    <script language="JavaScript">dT();</script>

  • #10
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Sorry about the late response. In your javascript.js file, you have <script> tags in it. You don't need those, remove them.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #11
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    No difference with em' removed..

  • #12
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Hmm... When I go to the live page I find this:
    Code:
    <script type="text/javascript" src="test/javascripts.js"></script>
    But it needs to read like this:
    Code:
    <script type="text/javascript" src="javascripts.js"></script>
    Last edited by koyama; 07-04-2007 at 11:35 PM. Reason: typo

  • #13
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Hmm, i didn't see that. That's probably the answer to the problem.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #14
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    When will I ever learn...I had uploaded it to a wrong server, as I have 2 servers active...damn. Sorry and thanks for your great help - now it works!

    But I still have a problem with: this. How can I correct it?

    Also, it says that some of my CSS is invalid: Here
    Last edited by CaptainB; 07-05-2007 at 11:16 AM.

  • #15
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    Quote Originally Posted by CaptainB View Post
    When will I ever learn...I had uploaded it to a wrong server, as I have 2 servers active...damn. Sorry and thanks for your great help - now it works!

    But I still have a problem with: this. How can I correct it?
    Hey..
    Its clear from the explanation of error.
    If you want to call more than one item in mouseover event, use something like
    Code:
    onmouseover="dropdownmenu(this, event, menu1, '165px');delayhidemenu();"
    I guess, in your case it should be one in mouseover and the other in mouseout
    Code:
    onmouseover="dropdownmenu(this, event, menu1, '165px');" onmouseout="delayhidemenu();"
    regards,
    art.
    Last edited by abduraooft; 07-05-2007 at 01:06 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •