<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Lisa Wollin : Tips and Tricks</title><link>http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx</link><description>Tags: Tips and Tricks</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Working with Access databases that live outside of a Web site</title><link>http://blogs.msdn.com/lisawoll/archive/2005/07/19/440655.aspx</link><pubDate>Wed, 20 Jul 2005 02:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:440655</guid><dc:creator>lisawoll</dc:creator><slash:comments>46</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/440655.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=440655</wfw:commentRss><description>&lt;P&gt;We had a customer recently, who needed to access an Access database from both a classic ASP page and from another Access database. To prevent the database from being locked by IIS, the customer wanted to know if they could move the database out of the Web site directory. By default, FrontPage expects the database to be in the Web site. However, when they did this, it seemed to break FrontPage’s ability to work with the database connection as Front Page.&lt;/P&gt;
&lt;P&gt;Bernardo Iturriaga Dubost, one of the FrontPage testers, came to the rescue of this customer. Here's his response:&lt;/P&gt;
&lt;P&gt;The main reason that FrontPage stores the .mdb files in the web is so that you don’t need to access to the Web server to access the data in a database. However, you can provide dual access to a database by using a system DSN, and then using the DSN in FrontPage to connect to the database. Here's how:&lt;/P&gt;
&lt;P&gt;First, you need to create a system DSN on the Web server that hosts the Web site:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;From the &lt;B&gt;Start Menu&lt;/B&gt;, click &lt;B&gt;All Programs&lt;/B&gt;. 
&lt;LI&gt;Select &lt;B&gt;Administrative Tools&lt;/B&gt;, and click &lt;B&gt;Data Sources (ODBC)&lt;/B&gt;. 
&lt;LI&gt;Go to the &lt;B&gt;System DSN&lt;/B&gt; tab. 
&lt;LI&gt;Click &lt;B&gt;Add&lt;/B&gt;. 
&lt;LI&gt;Select the appropriate driver type (for example, MS access driver). 
&lt;LI&gt;Click &lt;B&gt;Finish&lt;/B&gt;. 
&lt;LI&gt;Provide a name and a description for the DSN. 
&lt;LI&gt;Click &lt;B&gt;Select&lt;/B&gt; the navigate to the actual .mdb file located in another folder on the server. 
&lt;LI&gt;Click &lt;B&gt;Ok&lt;/B&gt; when you're finish selecting the database. 
&lt;LI&gt;In most cases this is enough, but if the database requires a password, you'll need to provide one. To do this, click &lt;B&gt;Advanced&lt;/B&gt; and provide the password. 
&lt;LI&gt;Click &lt;B&gt;Ok&lt;/B&gt; again to create the DSN. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;After you're finished, you'll see your new named DSN listed on the &lt;B&gt;System DSN&lt;/B&gt; tab of the &lt;B&gt;ODBC Data Source Administrator&lt;/B&gt;.&lt;/P&gt;
&lt;P&gt;Next, you need tell FrontPage to use the DSN to connect to the database.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Start FrontPage and open the Web site. 
&lt;LI&gt;From the &lt;B&gt;Tools&lt;/B&gt; menu, click &lt;B&gt;Site Settings&lt;/B&gt;. 
&lt;LI&gt;On the &lt;B&gt;Database&lt;/B&gt; tab, click &lt;B&gt;Add&lt;/B&gt;. 
&lt;LI&gt;In the dialog select &lt;B&gt;System Data source on web server&lt;/B&gt;. 
&lt;LI&gt;Click &lt;B&gt;Browse&lt;/B&gt;. FrontPage displays a list of system DSN on the Web server. 
&lt;LI&gt;The connection that you created in the previous steps should be there, select it and click &lt;B&gt;Ok&lt;/B&gt;. 
&lt;LI&gt;Click &lt;B&gt;Ok&lt;/B&gt; to the &lt;B&gt;Site Settings&lt;/B&gt; dialog box, this will add the connection string to the global.asa file in the Web site. 
&lt;LI&gt;You can now use this connection to the database for database features in FrontPage for both ASP and ASP.NET. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Please note that in order to do this, you need to have access to the actual server that hosts the Web site. One benefit of this configuration is that you can have different permissions for the Web site and for the folder that contains the .mdb file. Please also note that for the users to get data when they browse, MACHINENAME_IUSR needs to have the appropriate read/write access permissions to the .mdb file; otherwise there will be an error. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=440655" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>Password Protecting Web Pages</title><link>http://blogs.msdn.com/lisawoll/archive/2005/06/24/432429.aspx</link><pubDate>Sat, 25 Jun 2005 01:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:432429</guid><dc:creator>lisawoll</dc:creator><slash:comments>27</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/432429.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=432429</wfw:commentRss><description>&lt;P&gt;John Jansen, one of the FrontPage testers, sent me these three different ways to password protect pages in FrontPage.&lt;/P&gt;
&lt;P&gt;&lt;A href="#gui"&gt;Using a FrontPage site template and ASP&lt;/A&gt;&lt;BR&gt;&lt;A href="#snippets"&gt;Using Code Snippets&lt;/A&gt;&lt;BR&gt;&lt;A href="#aspnet"&gt;Using ASP.NET&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A name=gui&gt;&lt;/A&gt;&lt;STRONG&gt;To password protect pages using a FrontPage site template and ASP&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Here are specific steps to password protect pages using features built into FrontPage:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;From the &lt;STRONG&gt;File&lt;/STRONG&gt; menu, click &lt;STRONG&gt;New&lt;/STRONG&gt;. 
&lt;LI&gt;From the &lt;STRONG&gt;Web Site&lt;/STRONG&gt; tab, select &lt;STRONG&gt;FrontPage Server Templates&lt;/STRONG&gt; from the first list, and then select &lt;STRONG&gt;Database Interface Wizard&lt;/STRONG&gt; from the second list. 
&lt;LI&gt;Type the location where you want to put your password protected page. This must be an Windows Web server running IIS. 
&lt;LI&gt;Click &lt;STRONG&gt;OK&lt;/STRONG&gt;. 
&lt;LI&gt;In the Wizard… 
&lt;OL&gt;
&lt;LI&gt;Click &lt;B&gt;Next&lt;/B&gt; to create an ASP solution. 
&lt;LI&gt;Click &lt;B&gt;Next&lt;/B&gt; to use the default name for the connection. 
&lt;LI&gt;Click &lt;B&gt;Next&lt;/B&gt; to use the default columns in the table. 
&lt;LI&gt;Click &lt;B&gt;Next&lt;/B&gt; after the DB is created. 
&lt;LI&gt;Click &lt;B&gt;Next&lt;/B&gt; to use the default table. 
&lt;LI&gt;Check the box to use a Database Editor. 
&lt;LI&gt;Click &lt;B&gt;Next&lt;/B&gt;. 
&lt;LI&gt;Choose a password and enter it. 
&lt;LI&gt;Click &lt;B&gt;Next&lt;/B&gt;. 
&lt;LI&gt;Click &lt;B&gt;Finish&lt;/B&gt;. &lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;After FrontPage finishes building the site, all of the necessary code for password protecting pages has been generated. In order to protect any new pages, simply put the following code:&lt;BR&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;!-- #include file=”login.asa” --&amp;gt;
&amp;lt;%
If Session(SiteId) &amp;lt;&amp;gt; true Then
Response.Redirect(“login.asp?requester=&amp;lt;!--insert page name here--&amp;gt;”)
End If
%&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;above the &lt;CODE&gt;&amp;lt;HTML&amp;gt;&lt;/CODE&gt; tag on any page and save as .asp. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;A name=snippets&gt;&lt;/A&gt;&lt;STRONG&gt;To password protect pages using Code Snippets&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Here are steps to create password protected pages using code snippets:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a new site in FrontPage. 
&lt;LI&gt;Create a new page and switch to Code view. 
&lt;LI&gt;Delete all the code in the new page. 
&lt;LI&gt;Paste the following code as a code snippet.&lt;PRE&gt;&amp;lt;%
Username="user"
Password="pass"
' if any of the variables do not match, create error message
if Request.Form("login") &amp;lt;&amp;gt; Username or Request.Form("password") &amp;lt;&amp;gt; Password then
    MsgErr = "&amp;lt;h3&amp;gt;Authorization Failed.&amp;lt;/h3&amp;gt;"
    Response.Write MsgErr
    ' if correct, set the session variable and proceed
Else
    Session("someStringValue") = true
    ' redirect
    If Len(Request("requester")) &amp;gt; 0 Then
        Response.Redirect (Request("requester"))
    Else
        Response.Redirect "protected.asp"
    End if
End if
%&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Results -- Login&amp;lt;/title&amp;gt;
    &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"&amp;gt;
    &amp;lt;meta name="GENERATOR" content="Microsoft FrontPage 6.0"&amp;gt;
    &amp;lt;meta name="ProgId" content="FrontPage.Editor.Document"&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body bgcolor="#FFFFFF"&amp;gt;
    &amp;lt;FORM ACTION="login.asp" METHOD="post"&amp;gt;
    &amp;lt;h3&amp;gt;Login&amp;lt;/h3&amp;gt;
        &amp;lt;TABLE BORDER=0&amp;gt; 
            &amp;lt;TR&amp;gt;
                &amp;lt;TD ALIGN="right"&amp;gt;User name:&amp;lt;/TD&amp;gt;
                &amp;lt;TD&amp;gt;&amp;lt;INPUT TYPE="text" NAME="login" size="10" VALUE=''/&amp;gt;&amp;lt;/TD&amp;gt;
            &amp;lt;/TR&amp;gt;
            &amp;lt;TR&amp;gt;
                &amp;lt;TD ALIGN="right"&amp;gt;Password:&amp;lt;/TD&amp;gt;
                &amp;lt;TD&amp;gt;&amp;lt;INPUT TYPE="password" NAME="password" size="10" VALUE=''/&amp;gt;&amp;lt;/TD&amp;gt;
            &amp;lt;/TR&amp;gt;
            &amp;lt;TR&amp;gt;
                &amp;lt;TD&amp;gt;&amp;lt;input TYPE="hidden" NAME="requester" VALUE="&amp;lt;%=Server.HtmlEncode(Request("requester"))%&amp;gt;"&amp;gt;&amp;lt;/TD&amp;gt;
                &amp;lt;TD&amp;gt;&amp;lt;/TD&amp;gt;
            &amp;lt;/TR&amp;gt;
            &amp;lt;TR&amp;gt;
                &amp;lt;TD align="left"&amp;gt;&amp;lt;INPUT TYPE="submit" VALUE="Login"/&amp;gt;&amp;lt;/TD&amp;gt;
                &amp;lt;TD&amp;gt;&amp;lt;/TD&amp;gt;
            &amp;lt;/TR&amp;gt;
        &amp;lt;/TABLE&amp;gt;
    &amp;lt;/FORM&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;
&lt;LI&gt;Save page as login.asp. 
&lt;LI&gt;Create a new page and switch to Code view (or do this with any page you want to protect with a password). 
&lt;LI&gt;Above the opening &amp;lt;html&amp;gt; tag, paste in the following snippet. &lt;PRE&gt;&lt;CODE&gt;&amp;lt;%
If Session("someStringValue") &amp;lt;&amp;gt; true Then
    Response.Redirect("Login.asp?requester=protected.asp")
End If
%&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;LI&gt;Save this page as protected.asp (or replace the requester text above from protected.asp to the page name you are protecting). 
&lt;LI&gt;Browse to protected.asp. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;A name=aspnet&gt;&lt;/A&gt;&lt;STRONG&gt;To password protect pages using ASP.NET&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Here are steps to password protect pages using ASP.NET:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a new page in your Web site and switch to code view. 
&lt;LI&gt;Select and delete all the code in the page. 
&lt;LI&gt;Paste in the following code. &lt;PRE&gt;&lt;CODE&gt;&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Please Log In&amp;lt;/h1&amp;gt;
    &amp;lt;hr&amp;gt;
    &amp;lt;form runat="server"&amp;gt;
    &amp;lt;table cellpadding="8"&amp;gt;
        &amp;lt;tr&amp;gt;
            &amp;lt;td&amp;gt;User Name:&amp;lt;/td&amp;gt;
            &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID="UserName" RunAt="server" /&amp;gt;&amp;lt;/td&amp;gt;
        &amp;lt;/tr&amp;gt;
        &amp;lt;tr&amp;gt;
            &amp;lt;td&amp;gt;Password:&amp;lt;/td&amp;gt;
            &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID="Password" TextMode="password" RunAt="server" /&amp;gt;&amp;lt;/td&amp;gt;
        &amp;lt;/tr&amp;gt;
        &amp;lt;tr&amp;gt;
            &amp;lt;td&amp;gt;&amp;lt;asp:Button Text="Log In" OnClick="OnLogIn" RunAt="server" /&amp;gt;&amp;lt;/td&amp;gt;
            &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;
        &amp;lt;/tr&amp;gt;
    &amp;lt;/table&amp;gt;
    &amp;lt;/form&amp;gt;
    &amp;lt;hr&amp;gt;
    &amp;lt;h3&amp;gt;&amp;lt;asp:Label ID="Output" RunAt="server" /&amp;gt;&amp;lt;/h3&amp;gt;
    &amp;lt;/body&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;script language="C#" runat="server"&amp;gt;
        void OnLogIn (Object sender, EventArgs e)
        {
            if (FormsAuthentication.Authenticate (UserName.Text, Password.Text))
                FormsAuthentication.RedirectFromLoginPage (UserName.Text, false);
            else
                Output.Text = "Invalid login";
        }
    &amp;lt;/script&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;LI&gt;Save the page as loginpage.aspx. 
&lt;LI&gt;Create a new page and switch to code view. 
&lt;LI&gt;Select and delete the code in the page. 
&lt;LI&gt;Paste the following code into the new page. &lt;PRE&gt;&lt;CODE&gt;&amp;lt;configuration&amp;gt;
    &amp;lt;system.web&amp;gt;
        &amp;lt;authentication mode="Forms"&amp;gt;
        &amp;lt;forms loginUrl="LoginPage.aspx"&amp;gt;
        &amp;lt;credentials passwordFormat="Clear"&amp;gt;
    &amp;lt;user name="Bruce" password="Batman"/&amp;gt;
    &amp;lt;/credentials&amp;gt;
    &amp;lt;/forms&amp;gt;
    &amp;lt;/authentication&amp;gt;
    &amp;lt;authorization&amp;gt;
    &amp;lt;deny users="?" /&amp;gt;
    &amp;lt;/authorization&amp;gt;
    &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;LI&gt;Save the page as web.config. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;And that’s all there is to that. Any aspx pages in the same folder as the web.config file are protected.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=432429" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Classic+ASP/default.aspx">Classic ASP</category></item><item><title>Creating a CSS File for your Web site</title><link>http://blogs.msdn.com/lisawoll/archive/2005/02/01/364734.aspx</link><pubDate>Tue, 01 Feb 2005 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:364734</guid><dc:creator>lisawoll</dc:creator><slash:comments>28</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/364734.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=364734</wfw:commentRss><description>&lt;p&gt;Dave Berry wrote an excellent article about Cascading Style Sheets (CSS) on MSDN (&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfp2k2/html/odc_fpusingcssonwebsite.asp" target="_blank"&gt;Using Cascading Style Sheets on Your Web Site&lt;/a&gt;), so I won't bore you with the details of CSS.&amp;nbsp; However, one reader commented that the article didn't cover how to create an external CSS file.&amp;nbsp; This is very easy, so here's how.&lt;/p&gt; &lt;p&gt;Say you have the following embedded style sheet on a page and you want to share the styles with other pages in your site. (See "Three Types of Cascading Style Sheets: External, Embedded, and Inline" in Dave's article.)&lt;/p&gt;&lt;pre&gt;&amp;lt;style&amp;gt;&lt;br /&gt;BODY&lt;br /&gt;{font-family: Comic Sans, Verdana, Tahoma, Arial;&lt;br /&gt;font-size: 10pt;&lt;br /&gt;margin: 0em;}&lt;br /&gt;&lt;br /&gt;P&lt;br /&gt;{padding-left: 5;&lt;br /&gt;padding-right: 5;}&lt;br /&gt;&lt;br /&gt;H1&lt;br /&gt;{font-size: 11pt;&lt;br /&gt;font-weight: bold;&lt;br /&gt;color: white;&lt;br /&gt;background: #FF3399;&lt;br /&gt;padding-top: 10;&lt;br /&gt;padding-bottom: 5;&lt;br /&gt;padding-left: 10;&lt;br /&gt;padding-right: 10;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;/pre&gt; &lt;p&gt;All you do is copy the contents of the STYLE element (the text between the tags but not the tags themselves) into a new file.&amp;nbsp; (In FrontPage 2003, you can create a new blank page, display the page in Code view, and paste the CSS code.&amp;nbsp; In earlier versions, you can either use HTML view or Notepad.)&amp;nbsp; Then save the file with a .CSS extension.&amp;nbsp; I usually call the main CSS file for a Web site web.css just for the sake of consistency, but you can name it anything you want.&lt;/p&gt; &lt;p&gt;The contents of your new file should look something like this:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;BODY&lt;br /&gt; {font-family: Comic Sans, Verdana, Tahoma, Arial;&lt;br /&gt; font-size: 10pt;&lt;br /&gt; margin: 0em;}&lt;br /&gt;&lt;br /&gt;P&lt;br /&gt; {padding-left: 5;&lt;br /&gt; padding-right: 5;}&lt;br /&gt;&lt;br /&gt;H1&lt;br /&gt; {font-size: 11pt;&lt;br /&gt; font-weight: bold;&lt;br /&gt; color: white;&lt;br /&gt; background: #FF3399;&lt;br /&gt; padding-top: 10;&lt;br /&gt; padding-bottom: 5;&lt;br /&gt; padding-left: 10;&lt;br /&gt; padding-right: 10;}&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Once you have the CSS file, you can remove the STYLE element and it's contents from the first page, and add a LINK element or an @Import statement.&amp;nbsp; I rarely have more than one CSS file for a Web site, so I generally use the LINK element (like the one shown below).&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;link rel="stylesheet" type="text/css" href="web.css"&amp;gt;&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;But if you anticipate using more than one CSS file in a Web site, you can use the @import statement, as shown in the following code:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt; @import url(web.css);&lt;br /&gt; @import url(page.css);&lt;br /&gt; &amp;lt;/style&amp;gt;&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Dave gives a great explanation of the difference between these two and what happens if two styles conflict with each other.&lt;/p&gt; &lt;p&gt;It really is that simple.&amp;nbsp; Deciding which styles to use is much more difficult.&amp;nbsp; I (personally) like the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference/css_ref_entry.asp" target="_blank"&gt;CSS attribute reference&lt;/a&gt; list on MSDN, but keep in mind that some of the CSS attributes listed are IE only (like the scrollbar styles).&amp;nbsp; Plus, there are literally dozens of online CSS resources.&amp;nbsp; Here are just a few that I found through the new &lt;a href="http://www.msn.com/" target="_blank"&gt;MSN search&lt;/a&gt;.&amp;nbsp; Try your own search and find your own CSS resources.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.stylegala.com/features/css-reference/" target="_blank"&gt;Stylegala CSS Reference&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.javascriptkit.com/dhtmltutors/cssreference.shtml" target="_blank"&gt;javascriptkit.com CSS Reference&lt;/a&gt; &lt;li&gt;&lt;a href="http://builder.com.com/5100-31-5071268.html" target="_blank"&gt;builder.com CSS Reference Table&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=364734" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/CSS/default.aspx">CSS</category></item><item><title>Customizing IntelliSense</title><link>http://blogs.msdn.com/lisawoll/archive/2005/01/14/353451.aspx</link><pubDate>Sat, 15 Jan 2005 03:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:353451</guid><dc:creator>lisawoll</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/353451.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=353451</wfw:commentRss><description>&lt;p&gt;If you've worked with Code view in FrontPage 2003, you've undoubtedly come to appreciate IntelliSense. But what if you need an element or attribute that isn't included in any of the default HTML schemas? For example, W3C accessibility guidelines include a &lt;a href="http://www.w3.org/TR/REC-html40/struct/tables.html#non-visual-rendering" target="_blank"&gt;&lt;b&gt;headers&lt;/b&gt; attribute&lt;/a&gt; for TD elements. If you frequently use the &lt;b&gt;headers&lt;/b&gt; attribute, love hand coding, and are tired of typing "headers" everytime you need to insert this attribute, this tip is for you.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Background&lt;/b&gt;&lt;/p&gt; &lt;p&gt;FrontPage uses XSDs (XML Schema Definition documents) to provide IntelliSense in Code view.&amp;nbsp; In fact, this is the same as what Visual Studio uses to provide IntelliSense for HTML and XML schemas, and FrontPage even uses many of the schema annotations that Visual Studio uses.&amp;nbsp; Schema annotations are contained in the schema definition (i.e., &lt;code&gt;&amp;lt;xsd:schema ... &amp;gt;&lt;/code&gt;) listed at the beginning of an XSD.&amp;nbsp; (For more information, see &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxgrfvisualstudioschemaannotations.asp" target="_blank"&gt;Visual Studio .NET Schema Annotations&lt;/a&gt;.) However, you should note that FrontPage does not use all of these annotations, so be careful using annotations or annotation values other those included in existing FrontPage IntelliSense schemas.&lt;/p&gt; &lt;p&gt;In addition, FrontPage provides IntelliSense only for HTML (including XHTML), not XML. So if you are inclined to playing with this feature by adding custom elements or using a custom XML schema, you may quickly find that IntelliSense for a selected schema won't function as expected or desired. However, making simple changes to existing HTML schema files (which I show you how to do in the procedure below) allows you to create some custom HTML IntelliSense.&lt;/p&gt; &lt;p&gt;You should also keep in mind that although changes you make may validate in Visual Studio or another XSD editor, FrontPage may not be able to understand them, which more than likely will break IntelliSense for all documents that use that schema.&amp;nbsp; Whenever possible, work with the XSD source code (such as in Notepad or XML view in Visual Studio) rather than with a visual XSD designer and make simple changes.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Breaking IntelliSense does not mean that IntelliSense will not work at all. Rather, IntelliSense won't work for documents that use a specific IntelliSense schema that FrontPage doesn't understand.&amp;nbsp; IntelliSense will work for other IntelliSense schemas.&amp;nbsp; Simply select a different schema from the &lt;b&gt;Schema Version&lt;/b&gt; option on the &lt;b&gt;Authoring&lt;/b&gt; tab of the &lt;b&gt;Page Options&lt;/b&gt; dialog box.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;More important things to remember when playing with IntelliSense schemas are&lt;/p&gt; &lt;ul&gt; &lt;li&gt;always copy the schema file so that you don't overwrite the original schema&amp;nbsp;making it impossible to recover the original schema without reinstalling FrontPage&amp;nbsp; &lt;li&gt;always change the vs:friendlyname annotation value at the beginning of the XSD so that you can differentiate between existing schemas and your custom schema (this value shows up under &lt;b&gt;Schema Version&lt;/b&gt; on the &lt;b&gt;Authoring&lt;/b&gt; tab of the &lt;b&gt;Page Options&lt;/b&gt; dialog box) &lt;li&gt;don't make too many changes before testing the schema in FrontPage (and always create a backup of your changes XSD before making additional changes in case an additional change breaks Intellisense) &lt;li&gt;never replace an existing schema with a custom schema (just in case a future service pack or update replaces this file, destroying all of your changes) &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;Procedure&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;Okay, now that you know all the gochas, the following instructions explain how to add the &lt;b&gt;headers &lt;/b&gt;attribute to a custom IntelliSense schema.&amp;nbsp; You can use these basic instructions to create additional IntelliSense schemas for FrontPage.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Close FrontPage. &lt;li&gt;Open Windows Explorer and navigate to:&lt;br /&gt;C:\Program Files\Common Files\Microsoft Shared\OFFICE11\SCHEMAS\HTML&lt;br /&gt;This folder contains the schema and type libraryfiles that FrontPage uses for IntelliSense. All the XSD files are IntelliSense. For example, ie3_2nav3_0.xsd contains IntelliSense for IE 3.2 and Netscape Navigator 3.0. &lt;li&gt;Copy IE5_0.xsd and change the name of the copied file to IE5_0_Modified.xsd. Copying makes sure that you don't overwrite the original file. DO NOT SKIP THIS STEP. &lt;li&gt;Open the new file in Notepad. &lt;br /&gt;&lt;b&gt;Note&lt;/b&gt; You can also use Visual Studio or another XSD editor. However, you should note that if you use something other than Notepad, you will need to view the source of the XSD in order to follow the remaining instructions.) &lt;li&gt;In Notepad, turn off Word Wrap (&lt;b&gt;Format&lt;/b&gt; menu). (This makes the schema easier to read and work with.) &lt;li&gt;In the opening XSD statement, locate vs:friendlyname="Internet Explorer 5.0" and add the word "Modified" to the friendly name so that it reads: vs:friendlyname="Internet Explorer 5.0 Modified" &lt;li&gt;Search for: name="td" &lt;li&gt;Scroll down to the list of attributes for the TD element. &lt;li&gt;Add a new attribute for "headers". For example, add the following text under one of the existing attributes. (I placed it beneath the &lt;b&gt;id&lt;/b&gt; attribute, but you can put it beneath any attribute for the TD element as long as you don't add it between the opening and closing tags of the attribute element for another HTML element.)&lt;br /&gt;&lt;code&gt;&amp;lt;xsd:attribute name="headers" /&amp;gt;&lt;/code&gt; &lt;li&gt;Save the file. &lt;li&gt;Start FrontPage. &lt;li&gt;From the &lt;b&gt;Tools&lt;/b&gt; menu, select &lt;b&gt;Page Options&lt;/b&gt;. &lt;li&gt;On the &lt;b&gt;Authoring&lt;/b&gt; tab, under &lt;b&gt;Schema Version&lt;/b&gt; (at the bottom of the dialog box), select Internet Explorer 5.0 Modified. &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;If you did everything right, when you add a TD element in Code view, you will find the headers attribute listed in the IntelleSense. The IntelliSense feature in FrontPage is very sensitive, so if you don't follow these instructions exactly, it may break Intellisense for your schema. Also, you can't make changes to the XSD while FrontPage is opened (or rather you can, but if you do, Intellisense will not function properly). You need to reboot FrontPage before IntelliSense schema changes take effect.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=353451" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>Modifying the FrontPage Date/Time Web Component</title><link>http://blogs.msdn.com/lisawoll/archive/2004/12/17/323871.aspx</link><pubDate>Sat, 18 Dec 2004 01:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:323871</guid><dc:creator>lisawoll</dc:creator><slash:comments>39</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/323871.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=323871</wfw:commentRss><description>&lt;p&gt;If you've ever inserted a date or time using &lt;b&gt;Date and Time&lt;/b&gt; on the &lt;b&gt; Insert&lt;/b&gt; menu in FrontPage, you may have wondered how you can change the date and/or time format. Well, you're not alone.&amp;nbsp; We recently had the following comment from a customer asking for just this kind of information.&lt;/p&gt; &lt;blockquote&gt;I want to know the parameters that can be changed, and how to change them, such as language to use - my web server is in Germany but I want to display months in English, not German, and UK time, not German. and eg what do the following mean: s-format="%d %B %Y" and what are the options for these and other parameters.&lt;/blockquote&gt; &lt;p&gt;Before I tell you how you can change the date and time formats, I should first explain that the date and time component is a server-side date and time component, which means that it displays the time on the server not the time on the client, so there's no way to specify a time zone (or in the case of the above comment, UK time instead of German time).&amp;nbsp; However, formatting is another thing altogether.&amp;nbsp; By changing the value of the s-format parameter, you can change how the date and time displays.&lt;/p&gt; &lt;p&gt;Let's backup a bit.&amp;nbsp; When you insert a date or time using the Date/Time Web component in FrontPage, FrontPage inserts webbot code.&amp;nbsp; This code looks somewhat like the following:&lt;/p&gt; &lt;pre&gt;&amp;lt;!--webbot bot=&amp;quot;Timestamp&amp;quot; S-Type=&amp;quot;REGENERATED&amp;quot; S-Format=&amp;quot;%m/%d/%Y %I:%M %p&amp;quot; --&amp;gt;&lt;/pre&gt; &lt;p&gt;The &lt;b&gt;bot&lt;/b&gt; parameter specifies &amp;quot;Timestamp.&amp;quot; This is what tells the FrontPage Server Extensions which Web component the webbot is using.&amp;nbsp; You can't change this parameter without completely wiping out your date or time.&amp;nbsp; (I know this seems like it should go without saying, but ... well, I've learned that almost nothing can go completely without saying.) However, the other two parameters, S-Type and S-Format, can be edited.&lt;/p&gt; &lt;p&gt;The S-Type parameter can have values of &amp;quot;EDITED&amp;quot; and &amp;quot;REGENERATED.&amp;quot;&amp;nbsp; Other values don't necessarily break the webbot, but they also don't mean anything. These are the only values that FrontPage generates from the &lt;b&gt;Date and Time&lt;/b&gt; dialog box, but to be completely honest, I didn't really notice a difference between the dates and/or times that these two values generate.&lt;/p&gt; &lt;p&gt;S-Format can have any combination of several values, and the ones that you use will affect how the date and/or time displays.&amp;nbsp; The following table provides a list of possible values and a description of each value.&amp;nbsp; (By the way, casing is critically important here.&amp;nbsp; For example, an uppercase M returns the minutes while a lowercase m returns the month.)&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;The examples in the following section use the following date/time as a guide:&lt;br /&gt; Friday, December 17, 2004 06:29:42 PM&lt;/p&gt; &lt;/blockquote&gt; &lt;table width="100%" id="table1" style="font-family:verdana; font-size:10pt;"&gt; &lt;tr&gt; &lt;th width="95"&gt;Parameter Value&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th width="86"&gt;Example&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%A&lt;/td&gt; &lt;td&gt;Day of the week in long format. (Date)&lt;/td&gt; &lt;td width="86"&gt;Friday&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%a&lt;/td&gt; &lt;td&gt;Day of the week in short format. (Date)&lt;/td&gt; &lt;td width="86"&gt;Fri&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%B&lt;/td&gt; &lt;td&gt;Month spelled out in long format. (Date)&lt;/td&gt; &lt;td width="86"&gt;December&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%b&lt;/td&gt; &lt;td&gt;Month spelled out in short format. (Date)&lt;/td&gt; &lt;td width="86"&gt;Dec&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%m&lt;/td&gt; &lt;td&gt;Month in number format. (Date)&lt;/td&gt; &lt;td width="86"&gt;12&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%d&lt;/td&gt; &lt;td&gt;Day of the month. (Date)&lt;/td&gt; &lt;td width="86"&gt;17&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%Y&lt;/td&gt; &lt;td&gt;Year in long format. (Date)&lt;/td&gt; &lt;td width="86"&gt;2004&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%y&lt;/td&gt; &lt;td&gt;Year in short format. (Date)&lt;/td&gt; &lt;td width="86"&gt;04&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%I&lt;/td&gt; &lt;td&gt;Hour in 12-hour format. (Time)&lt;/td&gt; &lt;td width="86"&gt;06&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%H&lt;/td&gt; &lt;td&gt;Hour in 24-hour format. (Time)&lt;/td&gt; &lt;td width="86"&gt;18&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%M&lt;/td&gt; &lt;td&gt;Minutes. (Time)&lt;/td&gt; &lt;td width="86"&gt;29&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%S&lt;/td&gt; &lt;td&gt;Seconds. (Time)&lt;/td&gt; &lt;td width="86"&gt;42&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="95"&gt;%p&lt;/td&gt; &lt;td&gt;Shows PM or AM. (Time)&lt;/td&gt; &lt;td width="86"&gt;PM&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;p&gt;You can create date and time formats using any combination of the above parameter values.&amp;nbsp; In addition, as long as a percent sign (%) preceeds each parameter value that indiates a date or time element, you can use extra characters, symbols, and spaces between these parameter values.&amp;nbsp; For example, you could create the date/time as shown in the example preceeding the table by using an S-Format value of &amp;quot;%A, %B %d, %Y %H:%M:%S %p&amp;quot;.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;You can use the percent sign (%) as a symbol by placing two percent signs together (%%). The FrontPage Server Extensions see this as an escape character sequence and display a single percent sign.&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;Before concluding, I should note that the date and time displayed when you use the Date/Time Web component is the date and/or time a page was saved NOT the current date or time on the server or a visitor's computer.&amp;nbsp; For the current date or time, you would need to use server-side scripting, such as ASP, to get the server's date or time or client-side scripting, such as JavaScript, to get the date or time on the visitor's computer.&amp;nbsp; (For JavaScript that displays the date and/or time, see &lt;a id="viewpost.ascx_TitleUrl" href="/lisawoll/archive/2004/06/11/153974.aspx"&gt; Dates, dates, and more dates...&lt;/a&gt;).&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=323871" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>Choosing Colors for your Web Site</title><link>http://blogs.msdn.com/lisawoll/archive/2004/12/14/301340.aspx</link><pubDate>Wed, 15 Dec 2004 00:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:301340</guid><dc:creator>lisawoll</dc:creator><slash:comments>186</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/301340.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=301340</wfw:commentRss><description>&lt;p&gt;Whether you're creating your first Web site or you're a seasoned Web designer/developer, choosing colors is always problematic. You want to make sure that the color gives the right impression. As Katherine Nolan points out in her article &lt;a href="http://office.microsoft.com/en-us/assistance/HA010429371033.aspx"&gt;Color it effective: How color influences the user&lt;/a&gt; on Office Online, no color is either positive or negative. All colors have both positive and negative connotations. In her article, Nolan has a table that lists popular colors and their common positive and negative connotations in Western culture.&lt;/p&gt; &lt;p&gt;However, beyond the psychological meanings of colors within different cultures, choosing colors that complement and coordinate well with other images on your site and perhaps even your company logo can be difficult. Add to that the fact that while there may be millions of colors on the color spectrum, only a limited number of these display well in Web browsers. Colors that do are called Web-safe colors.&lt;/p&gt; &lt;p&gt;To help you choose colors, you can find a multitude of color pickers online, many of which help you choose colors that are Web safe. Some color pickers are better than others, so today's post features several of the best color pickers I've found online.&lt;/p&gt; &lt;p&gt;The first color picker is one that came to me through &lt;a href="http://www.sitepoint.com"&gt;SitePoint&lt;/a&gt;. I receive several e-zines, one of which is from SitePoint. In a recent SitePoint Design e-zine, they featured a color picker that blew away all the color pickers that I had seen previously. It's called &lt;a href="http://www.wellstyled.com/tools/colorscheme2/index-en.html"&gt;Color Schemes Generator 2&lt;/a&gt; and was designed by &lt;a href="http://www.pixy.cz"&gt;Petr Stanicek&lt;/a&gt;. What I like about this color picker is that it defines, based on selections that you make, coordinating and contrasting colors, and then allows you to reduce the colors to Web safe colors. All you do is choose your main color from the color wheel on the left, and then select the variation that you want to use. The up arrow in the right upper corner next to the list of HEX color codes allows you to move the base color around so that you can see what it looks like as a background color and as a foreground color. You can even see what the colors look like to people who have vision problems.&lt;/p&gt; &lt;p&gt;The &lt;a href="http://www.pagetutor.com/pagetutor/makapage/picker/"&gt;PageTutor Color Picker II&lt;/a&gt;, the second color picker featured here, has long been one of my favorites. You can easily choose the background, text, and link text colors, and the page displayed on the right side of the page changes so that you can see what the page will look like if you use the chosen colors. The page even provides the HTML code and the HEX color values that you need to add to your pages.&lt;/p&gt; &lt;p&gt;Another very good color picker is VisiBone's &lt;a href="http://www.visibone.com/colorlab/"&gt;216-color Webmasters Color Palette&lt;/a&gt;. I like that I can add colors by clicking on the color in the color "wheel" and remove colors by clicking on the X in the bar to the right of the color wheel. All colors are listed with their RGB and CMYK color values as well as their HEX color value.&lt;/p&gt; &lt;p&gt;Here are a few more color pickers that are available on the Internet.&lt;br /&gt;&lt;a href="http://www.hypersolutions.org/pages/colorSel.html"&gt;Dougie's Color Picker&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.digitdesigns.com/colrPick/framePic.htm"&gt;DigitDesigns WebSite Color Picker&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.colors4webmasters.com/safecolor/"&gt;Colors4webmasters.com Color Picker&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dyn-web.com/javascript/cpick/"&gt;Dynamic Web Coding Color Picker&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.webcolors.freeserve.co.uk/pick4096.htm"&gt;Web Colors 4096 Color Picker&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.december.com/html/spec/color.html"&gt;John December's Hex Hub&lt;/a&gt;&lt;/p&gt; &lt;p&gt;These are only a few of what you can find on the Internet, but using them sure makes choosing colors more fun.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=301340" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/General/default.aspx">General</category></item><item><title>Creating Image Mouseovers</title><link>http://blogs.msdn.com/lisawoll/archive/2004/12/10/279773.aspx</link><pubDate>Sat, 11 Dec 2004 00:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:279773</guid><dc:creator>lisawoll</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/279773.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=279773</wfw:commentRss><description>&lt;p&gt;After I learned JavaScript, the first thing I did was create an image mouseover.&amp;nbsp;The one I created was relatively simple, just a few lines of code. I've since seen many more complex examples that do basically the same thing as my simple little script.&amp;nbsp;I'm not sure whether complex is better...although the complex examples do have two debatable benefits for the developers: one, making them hard to read (and thus hard to steal and modify); and two, making me feel incredibly stupid. Hmm. I definitely prefer simplicity.&lt;/p&gt; &lt;p&gt;The script that I made way back then was a simple one-function script that I called in both the onmouseover and onmouseout events.&amp;nbsp;The function took one parameter, which was a reference to the IMG element.&amp;nbsp;All I did was swap the image displayed for a new image by changing the src property.&amp;nbsp;Simple. Except that it didn't work in Netscape Navigator.&amp;nbsp;I never understood why, I just rewrote it.&lt;/p&gt; &lt;p&gt;I promised to provide an image mouseover script a few posts ago, so in today's post I'm providing a very simple mouseover script that you can use in your Web pages. This script is only slightly more complex than the one I first wrote, but it does the trick in a single function and only a few lines of code. This script works in Internet Explorer, Netscape Navigator, Mozilla, and Opera, and there doesn't appear to be any difference in the way the script functions in each browser.&lt;/p&gt; &lt;p&gt;The script makes a few assumptions that you will need to understand. It assumes that the filename for the normal, onmouseout image ends with &amp;quot;Off.gif,&amp;quot; and the active, onmouseover image ends with &amp;quot;On.gif.&amp;quot;&amp;nbsp;It also assumes that the images are stored in a folder named &amp;quot;graphics&amp;quot; that lives in the folder in which the page is stored. Your file structure and image-naming convention may be a bit different, so let me show you the script and explain it.&lt;/p&gt; &lt;pre&gt;function mouseoverImage(image)&lt;br /&gt; {&lt;br /&gt; var s = image.id;&lt;br /&gt; var ssrc = image.src;&lt;br /&gt; &lt;br /&gt; if (ssrc.match(/[Oo]ff/))&lt;br /&gt; {&lt;br /&gt; image.src = "graphics/" + s + "on.gif"&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt; image.src = "graphics/" + s + "off.gif"&lt;br /&gt; }&lt;br /&gt; }&lt;/pre&gt; &lt;p&gt;The script uses a regular expression to determine whether the string &amp;quot;off&amp;quot; exists in the filename (or the value of the src attribute of the IMG element passed by using the image argument). (If you are unfamiliar with regular expressions, see the article &lt;a href="http://office.microsoft.com/en-us/assistance/HP030923241033.aspx"&gt;Regular expressions&lt;/a&gt; on Office Online).&amp;nbsp;If the string exists, the script changes the image's src attribute to the &amp;quot;On&amp;quot; image, and if it doesn't exist, the script changes the src attribute to the &amp;quot;Off&amp;quot; image.&lt;/p&gt; &lt;p&gt;Here's the HTML that accompanies this script.&lt;/p&gt; &lt;pre&gt;&amp;lt;img src=&amp;quot;graphics/ImageOff.gif&amp;quot; id=&amp;quot;image&amp;quot; &lt;br /&gt; onmouseover=&amp;quot;javascript:mouseoverImage(this)&amp;quot; &lt;br /&gt; onmouseout=&amp;quot;javascript:mouseoverImage(this)&amp;quot;&amp;gt;&lt;/pre&gt; &lt;p&gt;This code assumes that you have two images: one named &amp;quot;imageOff.gif&amp;quot; and one named &amp;quot;imageOn.gif.&amp;quot; You should be able to easily modify the filenaming for your own images; however, your images should have a base string that is the same.&lt;/p&gt; &lt;p&gt;For example, you might want to use mouseover images with a menu. If the text for a menu item was &amp;quot;products,&amp;quot; your images might be named &amp;quot;productsOff.gif&amp;quot; and &amp;quot;productsOn.gif&amp;quot;; or the normal image might be &amp;quot;products.gif&amp;quot; and the mouseover image &amp;quot;productsOn.gif&amp;quot; or &amp;quot;productsOver.gif.&amp;quot;&lt;/p&gt; &lt;p&gt;There are a number of possible combinations, but my point is that they both have a base string of &amp;quot;products.&amp;quot;&amp;nbsp;So you would set the image's id attribute to the base, the src attribute to the normal, onmouseout image, and then set the script calls in the onmouseover and onmouseout events. If your images are named differently, you need to make a few modifications to the script as well.&lt;/p&gt; &lt;p&gt;The regular expression &amp;quot;[Oo]ff&amp;quot; locates the occurrence of &amp;quot;Off&amp;quot; or &amp;quot;off&amp;quot; in the filename.&amp;nbsp;If neither your normal nor your active image contains either string, the script won't function unless you change the regular expression. About the only thing that would complete this script is a script that preloads the images.&amp;nbsp;You can find numerous such scripts online, and FrontPage comes with a preload script.&amp;nbsp;I'll cover preloading images in a future post for those who may not understand why this is important.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=279773" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/JavaScript/default.aspx">JavaScript</category></item><item><title>Creating a scrolling marquee</title><link>http://blogs.msdn.com/lisawoll/archive/2004/12/02/274014.aspx</link><pubDate>Thu, 02 Dec 2004 23:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:274014</guid><dc:creator>lisawoll</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/274014.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=274014</wfw:commentRss><description>&lt;p&gt;In FrontPage, you can create a scrolling marquee by clicking &lt;b&gt;Insert&lt;/b&gt; and &lt;b&gt;Web Component&lt;/b&gt;. (You can find it listed under Dynamic Effects.)&amp;nbsp; However, sometimes it's greyed out. This is because FrontPage inserts a MARQUEE element, which is only viewable from Internet Explorer. (Opera also displays the MARQUEE element properly.) To be able to add a marquee to your page, you need to specify that you are creating a page to be viewed only with Internet Explorer. You can do this from the &lt;b&gt;Authoring&lt;/b&gt; tab of the &lt;b&gt;Page Options&lt;/b&gt; dialog box (&lt;b&gt;Tools&lt;/b&gt; menu). Under &lt;b&gt;Browsers&lt;/b&gt;, select &lt;i&gt;Microsoft Internet Explorer Only&lt;/i&gt;.&lt;/p&gt; &lt;p&gt;Now that you know how to add a scrolling marquee, you may want to customize it. By default, FrontPage doesn't set any attributes when it inserts a marquee, so what you get is plain text that scrolls from right to left across the page. FrontPage provides a dialog box that allows you to change the direction (left or right), speed, behavior, size, and background color and specify whether the marquee repeats and how many times. This may provide all the functionality you want for your marquee, but what if you want to bold some text or add an image? Or what if you want the marquee to scroll from top to bottom or vice versa? One customer who contacted me wanted to make each letter a different color. Another customer wanted to add a hyperlink.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Customizing a Marquee&lt;/b&gt;&lt;/p&gt; &lt;p&gt;To add customizations that FrontPage doesn't allow in the dialog box, you need to modify the HTML code in &lt;b&gt;Code&lt;/b&gt; view.&amp;nbsp; You can add almost any element you want to a marquee, and it will work perfectly fine. However, keep in mind that when you do this, the display in FrontPage will be ... uh ... funky.&amp;nbsp; The MARQUEE element is one of the few HTML elements that FrontPage does not display exactly WYSIWYG.&amp;nbsp; Instead, you see all the code that you add within the opening and closing &amp;lt;marquee&amp;gt; tags. FrontPage sees these as text, but the browser does not.&lt;/p&gt; &lt;p&gt;For example, perhaps you want to add a hyperlink to some text.&amp;nbsp; You can switch to &lt;b&gt;Code&lt;/b&gt; view and insert the hyperlink by adding an A element to the code (note that using the &lt;b&gt;Hyperlink&lt;/b&gt; dialog box will add a hyperlink around the entire marquee and not just around selected text).&amp;nbsp; To illustrate, I created a simple marquee and inserted a hyperlink around a portion of the text.&amp;nbsp; In &lt;b&gt;Design&lt;/b&gt; view, my marquee appears as shown in the following screen shot.&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.wollinweb.com/blogimages/marquee1.gif" /&gt;&lt;/p&gt; &lt;p&gt;But in the browser, it scrolls as expected with hyperlinked text.&lt;/p&gt; &lt;p&gt;So now that you understand that what you see in FrontPage won't be exactly correct, you can add any number of other HTML elements to a MARQUEE element.&amp;nbsp; You can add P elements to create paragraphs; IMG elements to insert pictures; UL, OL, and LI elements to create numbered and bulleted lists; SPAN elements to change the color and font of one or more characters; B elements, I elements, U elements, DIV elements, etc.&amp;nbsp; (You can even add MARQUEE elements, which gives you overlapping scrolling marquees. This may sound kinda cool but it would be very strange if not done exactly right&amp;nbsp;— for example, a top to bottom scrolling marquee that contains a right to left scrolling marquee might be a bit interesting....)&lt;/p&gt; &lt;p&gt;&lt;b&gt;Vertical Scrolling Marquee&lt;/b&gt;&lt;/p&gt; &lt;p&gt;In the &lt;b&gt;Marquee Properties&lt;/b&gt; dialog box, FrontPage provides the ability to change the direction of the scroll from left to right or right to left (the default is right to left). However, the MARQUEE element allows for scrolling from top to bottom and bottom to top as well. After you insert the marquee into your page, switch to Code view and change the direction attribute of the MARQUEE element to "up" to scroll from bottom to top or "down" to scroll from top to bottom.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Scripting the MARQUEE element&lt;/b&gt;&lt;/p&gt; &lt;p&gt;There are a variety of things that you can do to change the appearance of scrolling marquees, but one I saw recently was someone who wanted the marquee to slow down upon mouseover.&amp;nbsp; As long as browser compatibility isn't an issue, since this only works in IE, you can script the MARQUEE element to slow down on mouseover, and then to speed up on mouseout.&lt;/p&gt; &lt;p&gt;The following two functions, slow and fast, change the scroll speed (by changing the scrollAmount property) of a specified MARQUEE element.&lt;/p&gt;&lt;pre&gt;&amp;lt;script language="javascript"&amp;gt;&lt;br /&gt; function slow(ele)&lt;br /&gt; {&lt;br /&gt; ele.scrollAmount = 1;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; function fast(ele)&lt;br /&gt; {&lt;br /&gt; ele.scrollAmount = 15;&lt;br /&gt; }&lt;br /&gt; &amp;lt;/script&amp;gt;&lt;/pre&gt; &lt;p&gt;All you need to do to see this in action is to add the following HTML code to a page and display th page in IE.&lt;/p&gt; &lt;pre&gt;&amp;lt;marquee direction="up" width="238" height="100%"&lt;br /&gt; scrollamount="15" onmouseout="javascript:fast(this);"&lt;br /&gt; onmouseover="javascript:slow(this);"&amp;gt;This is a test.&amp;lt;/marquee&amp;gt;&lt;/pre&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=274014" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/JavaScript/default.aspx">JavaScript</category></item><item><title>Creating an RSS Feed</title><link>http://blogs.msdn.com/lisawoll/archive/2004/11/19/266972.aspx</link><pubDate>Fri, 19 Nov 2004 20:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:266972</guid><dc:creator>lisawoll</dc:creator><slash:comments>45</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/266972.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=266972</wfw:commentRss><description>&lt;p&gt;I've had several people ask me lately and have seen questions on Office Online about how to create an RSS feed. For those of you who don't know what an RSS feed is, it's something that people can use to keep up to date with the content on a site. Generally, sites that frequently publish content, like news sites or magazines, offer RSS feeds to which visitors can subscribe. Then when they publish content, they update the RSS feed and people who have subscribed to the feed will get a list of newly published content. (This is probably a somewhat simplistic explanation, but that's it, in a nutshell.)&lt;/p&gt; &lt;p&gt;If you have a site that contains content, such as articles or stories, and you frequently update the site, then you may want an RSS feed to help your customers keep up with your updates.&lt;/p&gt; &lt;p&gt;&lt;b&gt;What is RSS?&lt;/b&gt;&lt;/p&gt; &lt;p&gt;RSS stands for Really Simple Syndication (although I've seen some sites refer to it as Rich Site Summary, also). RSS is basically an XML document that conforms to a specified XML schema. Short of regurgitating all the information that is available to explain RSS, I'll let you review the following resources. The all contain great information about what RSS is.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html"&gt;What is RSS?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.webreference.com/authoring/languages/xml/rss/intro/"&gt;Introduction to RSS (from webreference.com)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mnot.net/rss/tutorial"&gt;RSS Tutorial for Content Publishers and Webmasters&lt;/a&gt;&lt;/p&gt; &lt;p&gt;These are just a few. There are a hundred and one more resources for RSS; do an Internet search for "RSS", and you will likely come up with your own list of resources.&lt;/p&gt;There are several different versions of RSS schemas, many created by various organizations. (The first link in the above list (What is RSS?) provides a table that briefly describes each version.) I'm sure there are experts in RSS who have an opinion about which one is the best to use. I'm not an expert, so I'm not making any recommendation. The schemas can vary some minimally, others hugely. &lt;p&gt;&lt;b&gt;RSS 2.0&lt;/b&gt;&lt;/p&gt; &lt;p&gt;To help you understand how the schemas work and how to create your own RSS feed, the following XML code shows the basic XML for RSS 2.0, which is the version MSDN uses.&lt;/p&gt;&lt;pre&gt;&amp;lt;rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;lt;channel&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;link&amp;gt;&amp;lt;/link&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;description&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;item&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;link&amp;gt;&amp;lt;/link&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;description&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/item&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;lt;/channel&amp;gt;&lt;/pre&gt;&lt;pre&gt; &amp;lt;/rss&amp;gt;&lt;/pre&gt; &lt;p&gt;Before I get too far, I should explain that this is not a schema reference. Technology at Harvard Law has a great &lt;a href="http://blogs.law.harvard.edu/tech/rss"&gt;RSS 2.0 Specification&lt;/a&gt; schema reference that you should use if you need specific information about the elements. Plus I stripped down the XML above (for example, I removed the comments sections) so that you could see the XML without all the added text.&lt;/p&gt; &lt;p&gt;Briefly, each RSS feed that adheres to the 2.0 version contains one &lt;b&gt;channel&lt;/b&gt; element. Some of the child elements for the &lt;b&gt;channel&lt;/b&gt; element are optional, but the &lt;b&gt;title&lt;/b&gt;, &lt;b&gt;link&lt;/b&gt;, and &lt;b&gt;description&lt;/b&gt; are required. The &lt;b&gt;channel&lt;/b&gt; element may contain one or more &lt;b&gt;item&lt;/b&gt; elements. Many of the child elements for the item element are optional, but the &lt;b&gt;title&lt;/b&gt;, &lt;b&gt;link&lt;/b&gt;, and &lt;b&gt;description&lt;/b&gt; are required. The above example provides the required elements for both the &lt;b&gt;channel&lt;/b&gt; and &lt;b&gt;item&lt;/b&gt; elements.&lt;/p&gt;If you think of an RSS feed like a newspaper, the &lt;b&gt;channel &lt;/b&gt;element contains the name of the newspaper, a link to the newspaper's Web site, and a description of the newspaper; then each &lt;b&gt;item&lt;/b&gt; element is a different story in the newspaper, each containing the title of the story, a link to where the story can be found online, and a description of the story, which in some cases may be the full story. &lt;p&gt;&lt;b&gt;Publishing your RSS file&lt;/b&gt;&lt;/p&gt; &lt;p&gt;Now that you've been introduced to one RSS schema, and you've likely read a bit more about the different versions, you should be ready to create your own RSS file for your Web site. You can create and edit your RSS file in FrontPage, Visual Studio, Notepad, or another XML or text editor. Once you've created it, you need to save it as an XML file (with a .xml extension) and upload it to your Web site.&lt;/p&gt; &lt;p&gt;Then you need to create a link so that people who want to can subscribe to it. Generally, you will want to use the little orange XML graphic and link the image to the XML file. I've noticed that most sites that have RSS feeds use the little orange XML graphic or a slight variation, but not all. I'm not sure if there are any rules about using the orange graphic, but it's very easy to identify so that those who are looking for an RSS feed on your site can easily find it. To get a copy of the image, just right-click on the image and save it locally, and then upload it to your Web site.&lt;/p&gt;After you've created your first RSS file and provided the link to it on your Web site, all you need to do is update the file when you publish new content -- daily, weekly, monthly, or whatever works for you. I suggest that you don't save the same RSS file multiple times with different filenames. If you do, those who have subscribed to your RSS feed won't be able to keep their news aggregators updated without pulling the URL to the new file. Just update the file and reuse the same filename. &lt;p&gt;The RSS files that I reviewed had the most recent content at the top of the file. This allows subscribers to easily find the new content and move on. Again, I'm not sure if there are any rules to this, but if you want to know how subscribers will view your feeds, I would suggest either buying an RSS news aggregator or downloading a free trial version. I use &lt;a href="http://www.newsgator.com"&gt;Newsgator&lt;/a&gt; in Outlook, but there are many different news aggregators, so do some research to see which one works. In addition, different news aggregators may display the RSS feeds differently, so you may want to install more than one to see what the differences are.&lt;/p&gt; &lt;p&gt;Well, that's it. About the only thing I've done here is provide just basic information. There are many many many more resources online that will provide more detailed information about RSS and how to create your own feed. If you're new to XML, I highly suggest becoming more familiar before starting to create your own RSS feed. Once you have a basic understanding of XML and RSS, you should be able to create the RSS feeds you need for your own Web site.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=266972" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/General/default.aspx">General</category></item><item><title>Display a different image inside a data view web part based on data in the XML </title><link>http://blogs.msdn.com/lisawoll/archive/2004/11/11/255808.aspx</link><pubDate>Thu, 11 Nov 2004 18:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:255808</guid><dc:creator>lisawoll</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/255808.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=255808</wfw:commentRss><description>&lt;p&gt;If you use lists in Web sites based on Windows SharePoint Services, this tip is for you. John Jansen, a tester on the FrontPage test team created a tip for how to display a different image depending on the value of a list item. See how on the &lt;A href="http://blogs.msdn.com/frontpoint/articles/255772.aspx"&gt;FrontPoint blog&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=255808" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>Hiding the Image Toolbar in IE</title><link>http://blogs.msdn.com/lisawoll/archive/2004/11/09/254733.aspx</link><pubDate>Tue, 09 Nov 2004 23:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:254733</guid><dc:creator>lisawoll</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/254733.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=254733</wfw:commentRss><description>&lt;p&gt;If you've spent any time browsing the Internet with Internet Explorer, you've seen the little toolbar that IE displays over larger images.&amp;nbsp; Today's tip, contributed by Larry Anderson, explains how to hide this little bugger.&lt;/p&gt; &lt;div style="MARGIN-LEFT: 30px"&gt; &lt;p&gt;In Internet Explorer 6.0, when a picture larger than 130x130 is displayed, IE displays the image toolbar (save, print, etc.). Sometimes the image toolbar can make a page look a little 'funky' and disabling it along with using&amp;nbsp;a script to block right clicks can cut down on 'picture stealing' from your site.&lt;/p&gt; &lt;p&gt;You can make your page not display the image toolbar on an image-by-image basis by adding GALLERYIMG="no" to the &amp;lt;IMG&amp;gt; tag, as shown in the following code example:&lt;/p&gt;&lt;pre&gt;&amp;lt;IMG SRC="mypicture.jpg" HEIGHT="100px" WIDTH="100px" GALLERYIMG="no"&amp;gt;&lt;/pre&gt; &lt;p&gt;Or you can disable the display of the image toolbar for an entire Web page by setting the &lt;a title="http" href="http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/httpequiv.asp"&gt;HTTP-EQUIV&lt;/a&gt; and &lt;a title="http" href="http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/content.asp"&gt;CONTENT&lt;/a&gt; attributes of the &lt;a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/meta.asp"&gt;META&lt;/a&gt; element. Set &lt;span class="clsLiteral"&gt;HTTP-EQUIV="imagetoolbar"&lt;/span&gt; and &lt;span class="clsLiteral"&gt;CONTENT="no"&lt;/span&gt;. Just put the following code in the HEAD section of your page, and IE doesn't display the image toolbar for any image in the page.&lt;/p&gt;&lt;pre&gt;&amp;lt;META HTTP-EQUIV="imagetoolbar" CONTENT="no"&amp;gt;&lt;/pre&gt; &lt;p&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;This is a great tip.&amp;nbsp; I truly detest this toolbar because it just plain messes up the look of a page, so IMHO, hiding it is a great idea. Just one thing I want to add is that hiding the image toolbar and disabling right click on a Web page doesn't provide true security for images and other copyrighted artwork.&amp;nbsp; At best, it slows people down. (For more information, see my post &lt;A href="http://blogs.msdn.com/lisawoll/archive/2004/07/28/200009.aspx"&gt;Securing online content and images&lt;/a&gt;.) &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=254733" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>Creating Mouseover Effects</title><link>http://blogs.msdn.com/lisawoll/archive/2004/10/27/248763.aspx</link><pubDate>Wed, 27 Oct 2004 21:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:248763</guid><dc:creator>lisawoll</dc:creator><slash:comments>26</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/248763.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=248763</wfw:commentRss><description>&lt;p&gt;I know, it's been awhile since I've posted a tip. A couple weeks ago I was in SQL Server training, and last week was taken up with catching up on everything I postponed during training.&amp;nbsp; Now I'm back and my tip for today is creating mouseover effects.&lt;/p&gt; &lt;p&gt;We get frequent questions about how to create mouseover effects, but there are a variety of different mouseover effects, and the scripts that accomplish them are very varied.&amp;nbsp; The tip I'm sharing today is a script that I created for selling a house.&amp;nbsp; The page shows a house plan; the house plan image contains image maps that when a user runs their mouse over, displays an image of the room next to the house plan.&amp;nbsp; Take a look at the &lt;a href="http://www.wollinweb.com/BlogImages/house.htm" target="_blank"&gt;finished page&lt;/a&gt; so that you can understand the type of mouseover I'm talking about here.&lt;/p&gt; &lt;p&gt;Creating this type of mouseover is relatively easy.&amp;nbsp; You have two main images on the page: one is the image that the user mouses over, the other is the image that changes upon mouseover. In this particular example, the house plans image is the first image.&amp;nbsp; I mapped the image (or created hot spots) to section it into rooms; each one of the rooms has an AREA element with an &lt;b&gt;href&lt;/b&gt; attribute value that contains the path and filename of the image to show on click, plus an &lt;b&gt;onmouseover&lt;/b&gt; event to show the image in a second image on the page.&amp;nbsp; (You can easily create an image map in FrontPage -- see &lt;a href="http://office.microsoft.com/en-us/assistance/HP052611731033.aspx" target="_blank"&gt;Add a hot spot to a graphic&lt;/a&gt; -- so don't worry about trying to create an image map by hand; however, you will need to add the &lt;b&gt;onmouseover&lt;/b&gt; event to each AREA element by hand.)&lt;/p&gt; &lt;p&gt;Okay, maybe that sounds confusing, so let me make it a bit easier.&amp;nbsp; If you've taken a look at the page, you see an image of the house plans on the left side of the page and on the right you see a picture of the front of the house.&amp;nbsp; The house plans image is the first image (as I mentioned above). The picture of the front of the house, the second image, is actually a container image.&amp;nbsp; When the page first displays, it shows the front of the house, but as the user drags the mouse pointer over the house plans, the picture of the front of the house changes to show a picture of the room over which the mouse pointer sit.&amp;nbsp; (Depending on the speed of your connection, you may need to wait a few seconds for the image to download.)&lt;/p&gt; &lt;p&gt;The script that makes this happen is all of two lines. To make it easy for you, I've included the function below.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;function ShowPic(sImage)&lt;br /&gt; {&lt;br /&gt; sImage = "images/" + sImage + ".jpg";&lt;br /&gt; document.ShowRoom.src = sImage;&lt;br /&gt; }&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;The script by it self does nothing spectacular.&amp;nbsp; The ShowPic function takes a string (sImage), which is the name of the image file to display on mouseover.&amp;nbsp; The script then uses the string (sImage) to concatenate a new string that contains the path to the image file ("images/") with the passed in value (sImage parameter) and the image extension (which in this case is ".jpg").&amp;nbsp; Then the code uses the &lt;b&gt;src&lt;/b&gt; property to change the &lt;b&gt;src&lt;/b&gt; attribute of the second image (which I gave a name attribute of "ShowRoom") to the value of the sImage string.&lt;/p&gt; &lt;p&gt;BTW, the script won't work without an image named "ShowRoom".&amp;nbsp; You can either create an image named "ShowRoom" or change the ShowRoom in the line document.ShowRoom.src to the name of the IMG element that acts as your container image.&lt;/p&gt; &lt;p&gt;For my page, I used an image map, but you don't have to use a map.&amp;nbsp; For example, you could have a vertical menu bar that on mouseover changes a central image on the page to a different image.&amp;nbsp; In this case, the ShowRoom image container becomes your central image, and each of the elements in the menu bar (which could be IMG or A elements depending on how your menu bar is setup) contains the &lt;b&gt;onmouseover&lt;/b&gt; event with the script call.&lt;/p&gt; &lt;p&gt;In the page you viewed above, I put in styles, so to make it easier to see what's going on in the code, here's some HTML to accomplish a mouseover effect without styles and without an image map.&amp;nbsp; In this example, I use A elements instead of AREA elements; otherwise, the effect is the same.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;&lt;br /&gt; &amp;lt;head&amp;gt;&lt;br /&gt; &amp;lt;title&amp;gt;House For Sale&amp;lt;/title&amp;gt;&lt;br /&gt; &amp;lt;script language="javascript"&amp;gt;&lt;br /&gt; function ShowPic(sImage)&lt;br /&gt; {&lt;br /&gt; sImage = "http://www.wollinweb.com/blogimages/images/" + sImage + ".jpg";&lt;br /&gt; document.ShowRoom.src = sImage;&lt;br /&gt; }&lt;br /&gt; &amp;lt;/script&amp;gt;&lt;br /&gt; &amp;lt;/head&amp;gt;&lt;br /&gt; &amp;lt;body&amp;gt;&lt;br /&gt; &amp;lt;table width="800"&amp;gt;&lt;br /&gt; &amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td valign="top" width="160"&amp;gt;&lt;br /&gt; &amp;lt;p&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('outsidefront')" href="http://www.wollinweb.com/blogimages/images/outsidefront.jpg"&amp;gt;Outside front&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('bedroom3')" href="http://www.wollinweb.com/blogimages/images/bedroom3.jpg" alt="Office/third bedroom"&amp;gt;Office/third bedroom&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('bathroom2')" href="http://www.wollinweb.com/blogimages/images/bathroom2.jpg" alt="Second bathroom"&amp;gt;Second bathroom&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('bedroom2')" href="http://www.wollinweb.com/blogimages/images/bedroom2.jpg" alt="Second bedroom"&amp;gt;Second bedroom&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('livingroom1')" href="http://www.wollinweb.com/blogimages/images/livingroom1.jpg" alt="Living room"&amp;gt;Living room&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('diningroom')" href="http://www.wollinweb.com/blogimages/images/diningroom.jpg" alt="Dining room"&amp;gt;Dining room&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('masterbed1')" href="http://www.wollinweb.com/blogimages/images/masterbed1.jpg" alt="Master bedroom"&amp;gt;Master bedroom&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('masterbath1')" href="http://www.wollinweb.com/blogimages/images/masterbath1.jpg" alt="Master bathroom"&amp;gt;Master bathroom&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('laundryroom')" href="http://www.wollinweb.com/blogimages/images/laundryroom.jpg" alt="Laundry room"&amp;gt;Laundry room&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('kitchen')" href="http://www.wollinweb.com/blogimages/images/kitchen.jpg" alt="Kitchen"&amp;gt;Kitchen&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('sittingroom')" href="http://www.wollinweb.com/blogimages/images/sittingroom.jpg" alt="Sitting room"&amp;gt;Sitting room&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;a onmouseover="ShowPic('patio1')" href="http://www.wollinweb.com/blogimages/images/patio1.jpg" alt="Rear outside patio"&amp;gt;Rear outside patio&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt; &amp;lt;/p&amp;gt;&lt;br /&gt; &amp;lt;/td&amp;gt;&lt;br /&gt; &amp;lt;td&amp;gt;&amp;lt;img name="ShowRoom" src="http://www.wollinweb.com/blogimages/images/outsidefront.jpg"&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt; &amp;lt;/tr&amp;gt;&lt;br /&gt; &amp;lt;/table&amp;gt;&lt;br /&gt; &amp;lt;/body&amp;gt;&lt;br /&gt; &amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;The HTML above uses absolute paths to the image, so you can just copy it to a new page in FrontPage (replacing all the HTML in the page), and view it in the browser.&lt;/p&gt; &lt;p&gt;I hope you enjoy this tip.&amp;nbsp; It's simple, but mouseovers can be very powerful.&amp;nbsp; Next tip, I'll show you how to get image mouseovers in navigation bars where you are changing the image on mouseover and then back to the original image on mouseout. (Oh, BTW, this script works without problem in IE, Moz, NN, and Opera.)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=248763" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/JavaScript/default.aspx">JavaScript</category></item><item><title>Creating a Drop-down Menu</title><link>http://blogs.msdn.com/lisawoll/archive/2004/10/05/238395.aspx</link><pubDate>Wed, 06 Oct 2004 02:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:238395</guid><dc:creator>lisawoll</dc:creator><slash:comments>16</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/238395.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=238395</wfw:commentRss><description>&lt;p&gt;We had an article on MSDN for creating a drop-down menu, but after repeated attempts, I, like many of our customers, couldn't make the code work, so we're in the process of removing it.&amp;nbsp; We will (mostly likely) eventually replace it.&amp;nbsp; In the meantime, though, I promised that I would provide an alternative.&amp;nbsp; I have working code for a drop-down menu that works in IE, Mozilla, and Netscape Navigator (sort of -- I've noticed some funky onmouseout behavior in Mozilla and Netscape Navigator that I haven't been able to resolve).&lt;/p&gt; &lt;p&gt;The example is comprised of HTML, JavaScript, and CSS and is contained in the following two files:&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;a target="_blank" href="http://www.wollinweb.com/blogimages/horizmenu.htm"&gt;Drop-down menu example&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a target="_blank" href="http://www.wollinweb.com/blogimages/web.htm"&gt;CSS style sheet&lt;/a&gt; (or &lt;a href="http://www.wollinweb.com/blogimages/web.css"&gt;download it&lt;/a&gt;)&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;Here's a simple explanation of the menu table and the accompanying script.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Menu Table&lt;/b&gt;&lt;/p&gt; &lt;p&gt;The menu table is simple, but to make it to be usable on any ... uh, almost ... page, I surrounded the entire table with a DIV element.&amp;nbsp; The following code shows a shortened version of the menu table with the DIV element.&amp;nbsp; The DIV element has an &lt;b&gt;id &lt;/b&gt;attribute value so that the JavaScript code can access the child elements.&amp;nbsp; This was necessary in order to allow anyone who might use this code to have &amp;lt;div&amp;gt; tags elsewhere on the page without interfering with the expand/collapse functions of the JavaScript.&lt;/p&gt; &lt;pre&gt;&amp;lt;div id=&amp;quot;menu&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;table width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;... (missing code)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/tr&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/table&amp;gt;&lt;br /&gt; &amp;lt;/div&amp;gt;&lt;/pre&gt; &lt;p&gt;The table has a width of 100%, but if you wanted to specify an exact pixel measurement, you could easily do that without messing up the menus.&amp;nbsp; The table is comprised of one row (TR element) with multiple columns (TD elements).&amp;nbsp; In the live version, there are five columns with drop-down menus.&amp;nbsp; Each drop-down menu lives within its own cell in the table.&amp;nbsp; The code within this TD element is somewhat complex to provide for the proper expand/collapse funtionality of the drop-down menu.&amp;nbsp; The following shows the code for the first TD element.&amp;nbsp; Each of the TD elements are almost exactly the same with a few exceptions, which I'll explain in a moment.&lt;/p&gt; &lt;pre&gt;&amp;lt;td class=&amp;quot;button&amp;quot; width=&amp;quot;20%&amp;quot; valign=&amp;quot;top&amp;quot; id=&amp;quot;item1&amp;quot;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;onmouseover=&amp;quot;expand(this.id, 'menu1');&amp;quot;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;onmouseout=&amp;quot;collapse(this.id, 'menu1');&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Menu 1&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;... (missing code)&lt;br /&gt; &amp;lt;/td&amp;gt;&lt;/pre&gt; &lt;p&gt;The &lt;b&gt;class&lt;/b&gt; attribute names the style in the CSS that defines the table cells appearance when a user first displays the page.&amp;nbsp; The &lt;b&gt;width&lt;/b&gt; attribute is set to 20% so that each of the five drop-down menus will be of equal space.&amp;nbsp; Again this is an easy thing to change if you want to modify the code to suit your own needs.&amp;nbsp; The &lt;b&gt;id&lt;/b&gt; attribute is necessary as the scripts use these to access the TD element.&lt;/p&gt; &lt;p&gt;The missing code is the nested DIV element that contains the items in the drop-down menu.&amp;nbsp; The DIV element for the first menu item is shown below.&lt;/p&gt; &lt;pre&gt;&amp;lt;div id=&amp;quot;menu1&amp;quot; class=&amp;quot;exp&amp;quot; onmouseout=&amp;quot;collapse('item1', this.id);&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;page.htm&amp;quot; class=&amp;quot;menuitem&amp;quot;&amp;gt;Item 1&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;page.htm&amp;quot; class=&amp;quot;menuitem&amp;quot;&amp;gt;Item 2&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;page.htm&amp;quot; class=&amp;quot;menuitem&amp;quot;&amp;gt;Item 3&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;page.htm&amp;quot; class=&amp;quot;menuitem&amp;quot;&amp;gt;Item 4&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;lt;/div&amp;gt;&lt;/pre&gt; &lt;p&gt;The nested DIV element also provides a value for the &lt;b&gt;id&lt;/b&gt; attribute. Again, the &lt;b&gt;class&lt;/b&gt; attribute specifies the style to use when displaying the menu. Within the DIV element are paragraphs (P elements), with a &lt;b&gt;class&lt;/b&gt; attribute value of &amp;quot;button&amp;quot;, a style defined in the attached CSS file, and links (A elements), with a &lt;b&gt;class&lt;/b&gt; attribute value of &amp;quot;menuitem&amp;quot;, another style defined in the attached CSS.&amp;nbsp; The menuitem style defines link, visited, hover, and active link styles.&lt;/p&gt; &lt;p&gt;Then, of course, there are the &lt;b&gt;onmouseover&lt;/b&gt; and &lt;b&gt;onmouseout&lt;/b&gt; events. The top-level menu item, contained in the TD element, specifies both the &lt;b&gt; onmouseover&lt;/b&gt; and &lt;b&gt;onmouseout&lt;/b&gt; events.&amp;nbsp; However, the drop-down menu, contained in the nested DIV element, specifies only the &lt;b&gt;onmouseout&lt;/b&gt; event.&amp;nbsp; The JavaScript functions that these events call require both the &lt;b&gt;id &lt;/b&gt;attribute for the TD element and the nested DIV element. &lt;/p&gt; &lt;p&gt;If you modify this script, adding or removing drop-down menus, you will want to change the second argument for these events. The following code shows the parts that you will need to change as you add and remove menus. The red code shows the &lt;b&gt;id&lt;/b&gt; attribute for the top-level menu item (TD element) and all the places where you would need to change this in the event function calls, and the blue code shows the &lt;b&gt;id&lt;/b&gt; attribute for the drop-down menu (DIV element) and all the places where you would need to change this in the event functions calls.&amp;nbsp; Basically, all the code in red must match and all the code in blue must match.&lt;/p&gt; &lt;pre&gt;&amp;lt;td class=&amp;quot;button&amp;quot; width=&amp;quot;20%&amp;quot; valign=&amp;quot;top&amp;quot; id=&amp;quot;&lt;font color="#FF0000"&gt;item1&lt;/font&gt;&amp;quot;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;onmouseover=&amp;quot;expand(this.id, '&lt;font color="#0000FF"&gt;menu1&lt;/font&gt;');&amp;quot;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;onmouseout=&amp;quot;collapse(this.id, '&lt;font color="#0000FF"&gt;menu1&lt;/font&gt;');&amp;quot;&amp;gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;&lt;font color="#800080"&gt;Menu 1&lt;/font&gt;&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;div id=&amp;quot;&lt;font color="#0000FF"&gt;menu1&lt;/font&gt;&amp;quot; class=&amp;quot;exp&amp;quot; onmouseout=&amp;quot;collapse('&lt;font color="#FF0000"&gt;item1&lt;/font&gt;', this.id);&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&lt;font color="#800080"&gt;page.htm&lt;/font&gt;&amp;quot; class=&amp;quot;menuitem&amp;quot;&amp;gt;&lt;font color="#800080"&gt;Item 1&lt;/font&gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&lt;font color="#800080"&gt;page.htm&lt;/font&gt;&amp;quot; class=&amp;quot;menuitem&amp;quot;&amp;gt;&lt;font color="#800080"&gt;Item 2&lt;/font&gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&lt;font color="#800080"&gt;page.htm&lt;/font&gt;&amp;quot; class=&amp;quot;menuitem&amp;quot;&amp;gt;&lt;font color="#800080"&gt;Item 3&lt;/font&gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&lt;font color="#800080"&gt;page.htm&lt;/font&gt;&amp;quot; class=&amp;quot;menuitem&amp;quot;&amp;gt;&lt;font color="#800080"&gt;Item 4&lt;/font&gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/div&amp;gt; &lt;br /&gt;&amp;lt;/td&amp;gt;&lt;/pre&gt; &lt;p&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Because the event function calls use &lt;code&gt;this.id&lt;/code&gt;, there's no need to specify the &lt;b&gt;id&lt;/b&gt; attribute values for these.&lt;/li&gt; &lt;li&gt;The code is purple above is code that you can safely change without affecting how the menus function.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;If you look at the full code in the page (see Drop-down menu example above), the only difference between each of the TD/DIV element pairs is the &lt;b&gt;id&lt;/b&gt; attribute value.&amp;nbsp; You'll notice that each menu is numbered consecutively (i.e., item1/menu1, item2/menu2, item3/menu3, etc.).&amp;nbsp; I did this for ease of use.&amp;nbsp; You can, of course, provide any &lt;b&gt;id&lt;/b&gt; attribute values you want, as long as they're not the same as another element on the page and as long as you change the appropriate arguments in the event function calls so that they match as shown above.&lt;/p&gt; &lt;p&gt;&lt;b&gt;JavaScript Functions&lt;/b&gt;&lt;/p&gt; &lt;p&gt;Now for the functions. There are three functions: one for collapsing all drop-down menus, one for expanding a single menu, and one for collapsing a single menu.&lt;/p&gt; &lt;p&gt;The first one, called collapseAll, collapses all menus. The collapseAll function takes no arguments and is called once when the page loads in the &lt;b&gt;onload&lt;/b&gt; event for the BODY. This code is relatively simple and is shown in the following example:&lt;/p&gt; &lt;pre&gt;function collapseAll()&lt;br /&gt; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var menuDiv = document.getElementById(&amp;quot;menu&amp;quot;);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var divs = menuDiv.getElementsByTagName(&amp;quot;div&amp;quot;);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var div;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for (i = 0; i &amp;lt; divs.length; i++)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;div = divs[i];&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;div.style.visibility = &amp;quot;hidden&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;div.style.display = &amp;quot;none&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; }&lt;/pre&gt; &lt;p&gt;The second function, called expand, is where most of the action happens ... uh, at least half of it.&amp;nbsp; The expand function has two parameters: Then, the function is basically a bunch of scripted CSS that is used to show the DIV element and change the appearance of the top-level menu.&amp;nbsp; The expand function is shown below:&lt;/p&gt; &lt;pre&gt;function expand(s, m)&lt;br /&gt; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var browser = window.navigator.appName;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var dif = 0;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if (browser != &amp;quot;Microsoft Internet Explorer&amp;quot;) { dif = 12; }&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var d = document.getElementById(m);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var td = document.getElementById(s);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var left = td.offsetLeft;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var top = td.offsetTop + 58;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var width = td.offsetWidth - dif;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;td.style.color = &amp;quot;&lt;font color="#800080"&gt;#FFFFFF&lt;/font&gt;&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;td.style.backgroundColor = &amp;quot;&lt;font color="#800080"&gt;#686496&lt;/font&gt;&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.top = top;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.left = left;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.width = width;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.position = &amp;quot;absolute&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.visibility = &amp;quot;visible&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.display = &amp;quot;block&amp;quot;;&lt;br /&gt; }&lt;br /&gt; &lt;/pre&gt; &lt;p&gt;There are a few things you should know about this code.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;First, there is a difference between how IE displays the menu and how Mozilla and Netscape Navigator display the menu. (Note that I haven't tested this code in Opera.)&amp;nbsp; In Moz and NN, the width doesn't show up properly, so I had to specify a value that would account for the difference between the offsetWidth and the actual width of the table in these browsers.&amp;nbsp; The number isn't arbitrary; I determined it by trial and error, and this was the only number than worked.&amp;nbsp; I have no idea why this is different only that it is and this number fixes it.&amp;nbsp; If you make huge changes to the menu, this number may need to be changed also.&lt;/li&gt; &lt;li&gt;Second, the number added to the offsetTop value accounts for the height of the first line in the top-level menu as well as the top heading paragraph.&amp;nbsp; Again, this number is not arbitrary and accounts for the space between the top of the browser and the top of the drop-down menu. I arrived at this number by a trial and error process.&amp;nbsp; If your top-level menu text runs onto multiple lines and/or you have a large graphic heading or other things above the menu bar, this number will likely change.&lt;/li&gt; &lt;li&gt;Third, if you want to change the appearance of the menu, you can change any of the values in purple in the code above to appropriate and desired values without affecting how the script functions.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;And finally, the third function, called collapse, collapses a single drop-down menu.&amp;nbsp; This is where the other half of the action happens.&amp;nbsp; The collapse function has two parameters: the first is the &lt;b&gt;id&lt;/b&gt; attribute value for the TD element (the top-level menu item), the second is is the &lt;b&gt;id&lt;/b&gt; attribute value for the nested DIV element (the drop-down menu). The collapse function is shown in the following code:&lt;/p&gt; &lt;pre&gt;function collapse(s, m)&lt;br /&gt; {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var d = document.getElementById(m);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var td = document.getElementById(s);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;td.style.color = &amp;quot;&lt;font color="#800080"&gt;black&lt;/font&gt;&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;td.style.backgroundColor = &amp;quot;&lt;font color="#800080"&gt;#EEEEEE&lt;/font&gt;&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.position = &amp;quot;static&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.visibility = &amp;quot;hidden&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;d.style.display = &amp;quot;none&amp;quot;;&lt;br /&gt; }&lt;/pre&gt; &lt;p&gt;There's absolutely nothing major about this code.&amp;nbsp; It changes the appearance of the TD element back to the original formatting, and hides the DIV element.&amp;nbsp; Ideally, this formatting would match what is in the attached CSS, which in this case, it does. You can change any of the values in purple in the code above to appropriate and desired values without affecting how the script functions.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/p&gt; &lt;p&gt;And that's all there is to it.&amp;nbsp; Have fun using this, and if you need help, please let me know. If you are looking for a drop-down menu, feel free to use it, or if you do an Internet search, you will find many more examples and just as many ways to create drop-down menus, and many of them much cooler than my litte example here.&lt;/p&gt; &lt;p&gt;Have fun, and enjoy playing with the code, and if you can tell me what's up with the Mozilla/Netscape issue, please do.&amp;nbsp; I've tried all types of arrangements for the code to see if order made a difference, if putting the event function call in a different place made a difference, and I've been relatively unsuccessful getting it to be completely functional in these browsers.&amp;nbsp; Sometimes the &lt;b&gt;onmouseout&lt;/b&gt; event just doesn't fire.&lt;/p&gt; &lt;p&gt;Anyway, as usual, my only real caveat is that the code won't work at all if the user has scripting turned off in their browser, but IMHO, that's not a reason to not use it or any other script.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=238395" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/lisawoll/archive/tags/JavaScript/default.aspx">JavaScript</category></item><item><title>Testing pages in different browsers</title><link>http://blogs.msdn.com/lisawoll/archive/2004/10/04/237786.aspx</link><pubDate>Mon, 04 Oct 2004 22:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:237786</guid><dc:creator>lisawoll</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/237786.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=237786</wfw:commentRss><description>&lt;p&gt;If you've worked around Web sites for any length of time, you've no doubt been told repeatedly to test your pages in several browsers. If you're new to this stuff, it may sound ridiculous.&amp;nbsp; After all, HTML is just HTML, right?&amp;nbsp; Well, yes ... and no.&lt;/p&gt; &lt;p&gt;HTML is just HTML, but different browsers render HTML differently.&amp;nbsp; In addition, some browser developers add custom elements that function correctly in their own browsers but not in competing browsers.&amp;nbsp; (For example, the MARQUEE element works only in Internet Explorer.)&amp;nbsp; Thus the advice to test your pages in different browsers is very important and very sound, especially if your audience may use other browsers.&lt;/p&gt; &lt;p&gt;In FrontPage 2003, you can easily test your pages in a browser by using the &lt;b&gt;Preview in Browser&lt;/b&gt; button &lt;img src="http://www.wollinweb.com/blogimages/previewinbrowser.gif" /&gt;.&amp;nbsp; Plus if you click the down arrow, you will get a list of browsers and different resolutions.&amp;nbsp; For example, if you wanted to see what your page would look like on a machine with 800x600 monitor resolution, you could choose the &lt;b&gt;Microsoft Internet Explorer 6.0 (800 x 600)&lt;/b&gt; item. &lt;/p&gt; &lt;p&gt;In addition, you can add browsers to the list by clicking &lt;b&gt;Edit Browser List&lt;/b&gt;.&amp;nbsp; When you add a browser to the list, you can also add items for the different resolutions for which you want to test your pages.&amp;nbsp; And (my personal favorite) &lt;b&gt;Preview in Multiple Browsers&lt;/b&gt; works very well for displaying your page in all the browsers in the browser list. &lt;/p&gt; &lt;p&gt;One HUGE caveat thought: If you're showing your page in both Netscape Navigator and Mozilla, you may get a message asking you to choose a profile. IMHO this user experience just sucks.&amp;nbsp; Navigator and Mozilla both use the same profile by default and should use different profiles not the same because you can't use the same profile in two browser windows at the same time.&amp;nbsp; Therefore, you have to create a new profile. (I've never been successful at saving the profile so that the browser would always use it, so I always get the dang message and have to create a new one every single time.) However, to fix this, there's a check box called &lt;b&gt;Don't ask at start up&lt;/b&gt;.&amp;nbsp; Check it!&amp;nbsp; You will likely still have to create a profile, at least once, but from that moment on, you shouldn't be asked again ... at least in theory.&amp;nbsp; I've never been successful at this one either.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=237786" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>Adding Videos to a Web Page</title><link>http://blogs.msdn.com/lisawoll/archive/2004/09/30/236330.aspx</link><pubDate>Thu, 30 Sep 2004 20:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:236330</guid><dc:creator>lisawoll</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/lisawoll/comments/236330.aspx</comments><wfw:commentRss>http://blogs.msdn.com/lisawoll/commentrss.aspx?PostID=236330</wfw:commentRss><description>&lt;p&gt;Today, someone asked me about how to add a video clip to a Web and show the controls.&amp;nbsp; This is relatively easy, so I thought I would share with all of you how to do this.&amp;nbsp; You can do this by using the Windows Media Player. To do this, switch to Code (or HTML) view and paste the following HTML code:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;object id="WMPlayer1" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" height="&lt;font color="#0000ff"&gt;250&lt;/font&gt;" width="&lt;font color="#0000ff"&gt;250&lt;/font&gt;"&amp;gt;&lt;br /&gt; &amp;lt;param name="uiMode" value="full" /&amp;gt;&lt;br /&gt; &amp;lt;param name="autoStart" value="true" /&amp;gt;&lt;br /&gt; &amp;lt;param name="URL" value="&lt;font color="#ff0000"&gt;SampleVideo.WMV&lt;/font&gt;" /&amp;gt; &lt;br /&gt; Your browser does not support ActiveX controls or the Windows Media Player.&lt;br /&gt; &amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;To make this work for your video file, change the value of the &lt;b&gt;value&lt;/b&gt; attribute (see red text above) to the path and filename of your video file. If you want to change the size of the view, change the value of the &lt;b&gt;height&lt;/b&gt; and &lt;b&gt;width&lt;/b&gt; attributes (see blue text above) to the height and width that you want.&lt;/p&gt; &lt;p&gt;Once you add the HTML, you can change the filename and size using the properties dialog box also. Just switch back to Design view and double click on the control.&lt;/p&gt; &lt;p&gt;This code displays video files in Internet Explorer and Netscape Navigator. I was unable to get this to display properly with Mozilla.&amp;nbsp; (I'm not sure if that means that Mozilla doesn't support Windows Media Player or ActiveX controls, or if there is a property that I need to set.&amp;nbsp; Anyway, I wasn't able to find an ActiveX property in the Preferences dialog, so I'm assuming that Mozilla doesn't support any ActiveX controls. If anyone has any information about this, please let me know.) I didn't test it in Opera (which I don't have installed on my computer, but I am rectifying since so many have offered comments about Opera), so I can't tell you whether it works in Opera or not. In addition, the visitor must have Active X controls enabled in their browser.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;This code works well as long as the visitor has Windows Media Player installed on their local computer.&amp;nbsp; If they don't, then they may be asked to install it. ActiveX controls are installed locally on the visitors machine, so they can have security risks associated with them.&amp;nbsp; Most browsers allow users to turn off installing, displaying, and running them, and Internet Explorer allows users to run them if they are signed, to prompt before installing them, and to disable unsigned ActiveX controls.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=236330" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/lisawoll/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item></channel></rss>