Solved

Newbie needs help with code for Show/Hide Layers

Posted on 2002-07-06
3
168 Views
Last Modified: 2012-05-04
I have created a page in the the  evaluation version of Dreamweaver MX. The page has a layer of text that shows two two other layers onmouserover, and hides the other two layers onmouseout. When viewed in IE 6.2, it appears to work as intended, but generates the following error message:

Line: 158
Char: 1
Error: Object Expected
Code: 0

Here is the Dreamweaver generated code assocoiated with the error message:

158 <div id="Text6" class="Main2" onMouseOver="return Text6_onMouseOver()" onMouseOut="return Text6_onMouseOut()"><font color="#444444" size="1" face="Arial, Helvetica, sans-serif">

159    <font size="2">H</font>EALTH <font size="2">C</font>ARE <font size="2">B</font>UYER</font></div>

Since I know nothing about code, I don't see anything wrong with it. The URL for the page is:
www.stonepcworks.com/vitality1.asp

All help is appreciated. Thanks, Bill
0
Comment
Question by:westone
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
joyriderank earned 100 total points
ID: 7138547
hi westone,

I have checked the code and corresponding page. Everything else seems to be fine but the initial div tag in the beginning of the font tag is extra. If you remove it everything works fine. Instead of it being what it is that is:

157 : <div id="Layer6" style="position:absolute; width:163px; height:16px; z-index:7; left: 10px; top: 320px;" onMouseOver="MM_showHideLayers('Layer12','','show','Layer13','','show')" onMouseOut="MM_showHideLayers('Layer12','','hide','Layer13','','hide')" class="Main2">
158 : <div id="Text6" class="Main2" onMouseOver="return Text6_onMouseOver()" onMouseOut="return Text6_onMouseOut()"><font color="#444444" size="1" face="Arial, Helvetica, sans-serif">
159 : <font size="2">H</font>EALTH <font size="2">C</font>ARE <font size="2">B</font>UYER</font></div>
160 : </div>

just remove the code as I have and everything will work fine. Here is how the code looks like after removing the extra code.

157 : <div id="Layer6" style="position:absolute; width:163px; height:16px; z-index:7; left: 10px; top: 320px;" onMouseOver="MM_showHideLayers('Layer12','','show','Layer13','','show')" onMouseOut="MM_showHideLayers('Layer12','','hide','Layer13','','hide')" class="Main2">
158 : <font color="#444444" size="1" face="Arial, Helvetica, sans-serif">
159 : <font size="2">H</font>EALTH <font size="2">C</font>ARE <font size="2">B</font>UYER</font>
160 : </div>

Similarly if you would remoe the extra <DIV> tag from in front of the text or font tag the error will disappear.

Hope this solves your problem.

TAKE CARE.

Joyriderank. :):):)
0
 

Author Comment

by:westone
ID: 7139332
Thank you very much! Dreamweaver generated all the code and I was clueless about the problem. Removing that extra stuff eliminated the error. Thanks again!
0
 
LVL 1

Expert Comment

by:joyriderank
ID: 7139661
You are most welcome.

Dreamweaver many times does that. With more and more experience you will be able to decide which is necesary and which is not. Actually having knowledge of Javascript will also help you decide which code to keep and which code to do away with.

Chalo that will be all for now. TAKE CARE.

Joyriderank.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now