swissbeets Posted July 16, 2008 Share Posted July 16, 2008 I am a very new to designing webpages and just recently got my site up and running. i am now at the point i want to validate my page, (only because i have read that it is important to have ur page validated) but i came up with so many errors i may never get through it. I am getting a lot of errors in the Javascript functions that preload the images for my navigation bar, i know these are fine because i copied them directly from dreamweaver? anyone else ever had this problem? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 first of all...Dreamweavers mouseovers for navigation are horrible. it can be done easier and faster WITHOUT javascript/preloading images, but takes a little bit of image editing. Step 1) Take the 2 images you have (one for the normal and one for the rollover) and make them one image, that is twice as tall. Put the normal image on top and the rollover below it. Step 2) Make your nav items empty <a> tags, with the href portion filled in of course. Step 3) Set the background-image style property on each A tag to the respective image from step 1 Step 3) In your Stylesheet, put something similar to the following: #navigation a { display: block; padding: 0; margin: 0; width: 270px; /* width of image */ height: 34px; /* height of 1 image - aka half height of image from step 1 */ background-repeat: no-repeat; background-position: 0 0; } #navigation a:hover { background-position: 0 -34px; /* negative version of height from above */ } Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 16, 2008 Author Share Posted July 16, 2008 why are they so bad? are they causing so many of my validation errors? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 i consider them bad cus they are a waste of code and resources. not sure about the errors unless i can see them. can you post a link to the site? i assume you are talking about validator.w3.org right? Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 16, 2008 Author Share Posted July 16, 2008 yes, http://validator.w3.org/, the site is www.bigpeckersstuff.com it is my first one, so there is still alot that needs done. i took all of the javascript out of the index to make sure that was the problem and it was but from any of the other pages you can see all the problems. Let me know if you see any glaring problems and please dont be too harsh.... Thank you Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 i'm looking at contactus.php....some big problems i see is that the javascript needs to be inside the HEAD tags. also, you have TWO sets of body tags. Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 16, 2008 Author Share Posted July 16, 2008 i will change that immediately thank you, i know very little javascript but figured since dreamweaver made it i might as well use it, i believe i got it working a lot better. please let me know of anything else you see it is greatly appreciated. i will attempt to get it validated today and then post my site to be critiqued but even with the javascript in the head i am getting 70 errors with at least 50 from the javascript is this alarge enough problem that i should take the way you posted earlier? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 yes Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 16, 2008 Author Share Posted July 16, 2008 ok i have began doing so , does this now mean that i have to completely redo my navigation bar( which was also created in dreamweaver)? or can i just use this one large picture as the main one and work from there? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 you should be able to keep everything Dreamweaver gave you...although i cringe looking at it Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 16, 2008 Author Share Posted July 16, 2008 eventhough i redid the navigation bar with dreamweaver and assigned only the up image, it is still using many of these javascript functions here is my code <td id="page"><a href="/index.php" target="_top" onclick="MM_nbGroup('down','group1','home','',1)" onmouseover="MM_nbGroup('over','home','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/home.gif" alt="" name="home" width="75" height="100" border="0" id="home" onload="" /></a><br /> <a href="/Products.php" target="_top" onclick="MM_nbGroup('down','group1','products','',1)" onmouseover="MM_nbGroup('over','products','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/products.gif" alt="" name="products" width="75" height="100" border="0" id="products" onload="" /></a><br /> <a href="/shoppingcart.php" target="_top" onclick="MM_nbGroup('down','group1','shoppingcart','',1)" onmouseover="MM_nbGroup('over','shoppingcart','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/shoppingcart.gif" alt="" name="shoppingcart" width="75" height="100" border="0" id="shoppingcart" onload="" /></a><br /> <a href="/contactus.php" target="_top" onclick="MM_nbGroup('down','group1','contactus','',0)" onmouseover="MM_nbGroup('over','contactus','','',0)" onmouseout="MM_nbGroup('out')"><img src="/images/contactus.gif" alt="" name="contactus" width="75" height="100" border="0" id="contactus" onload="" /></a><br /> it seems like it might be easier for me to just make it from scratch Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 that is how i write all my code (from scratch)...if you do do that, try to get rid of the tables and go the more modern DIV approach Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 16, 2008 Author Share Posted July 16, 2008 that would be more of changing many of the id's to div and then using css to modify them right? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 it would involve using DIVs to control the layout instead of TABLEs. TABLEs should only be used to tabular data (like spreadsheets) Quote Link to comment Share on other sites More sharing options...
swissbeets Posted July 16, 2008 Author Share Posted July 16, 2008 ok i will work with that, thank you very much, does a site have to be validated for google to give it a high page rank? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 um...i don't think that matters...but the fact that it validates means Google will be able to parse it properly Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.