Vertical house popout menu ie csshover.htc hack?
Last Post 12/22/2006 3:13 AM by Lee Sykes. 14 Replies.
Author Messages
D D
Nuke Newbie
Nuke Newbie
Posts:9


--
12/17/2006 4:38 PM  
I've noticed that most people are using the csshover.htc method to get around the css bug in ie that prevents it from displaying properly.

I tried using this solution but cant get it to work. I added the htc file to the root of my skin folder where my skin css file is. I added the behavior that checks for ie to the skin css file.  But still cant get ie 7 to display the popout menu?

I even tried copying a working example
http://www.htmldog.com/articles/suc...tical.html

directly into the menu part of my skin css but that didn't work either. Should the htc file be located in a different directory? Am I editing the wrong css file or forgetting something? I've gone through all of the tutorials for house menu and css on DNNCreative without any luck.

The site I am working on is:
http://216.94.10.127/dnn/

Thanks in advance for anyone's time.

Dan R.

Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
12/18/2006 10:54 AM  
Hello Dan,

I have not yet experimented with hover over vertical menus using CSS. Looking at the code from suckerfish. It appears as though this is achieved through 2 elements.

1) The javascript
2) the css

Have you tried placing the javascript directly within your skin.htm file, exactly as we have done in the simple red leaf skin?

or

If the javascript needs to be placed within the head section of the document, have a look at the sIFR tutorial as you need to also do this to enable sIFR.
Incorporating sIFR (Scalable Inman Flash Replacement) with DotNetNuke skins

Hope this helps, thanks,
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
D D
Nuke Newbie
Nuke Newbie
Posts:9


--
12/18/2006 11:15 AM  
Hi Lee,
First, thanks for taking the time to respond to my post.

I am using an edited copy of a free skin that does not contain an htm file only aspx and css. This is surely a newbie question but can I add the JS to the css code, or should I add the JS to the aspx page? Will either of these work? I read a few post here discussing the sIFR and it seemed a rather arduous process.

Thanks,
Dan
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
12/18/2006 11:31 AM  
Hi Dan,

I would add the javascript to the .aspx file. - This is the same as adding it to the .htm file.

sIFR is not that hard if you follow the video tutorial step by step.

Thanks,
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
D D
Nuke Newbie
Nuke Newbie
Posts:9


--
12/18/2006 11:59 AM  
Thanks Lee,
I'll give that a shot and post back my results.

I also notices that if I copy the exact code including the JS from

http://www.htmldog.com/articles/suc...tical.html

and past it into a DNN text module in html mode, the drop downs work in IE, so that also could be a workaround.
Though not a good one, all of the menu items would have to be hard coded; wasting the database component of DNN.
I'll post back my results with sIFR.

Regards,
Dan
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
12/18/2006 1:40 PM  
If the menu works using the Text / HTML module, all you will have to do is paste the javascript code into your skin.ascx file. You will not need to follow the sIFR method.

Thanks,

Lee
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
D D
Nuke Newbie
Nuke Newbie
Posts:9


--
12/18/2006 2:11 PM  
Hi Lee,
I mispoke before, I have a .ascx file and a css file in the skin folder. I tried adding the JS code into the .ascx file but that did not work. I also tried adding the JS code to the default.aspx file in the root of the dnn directory but that did not work also. Is there a different file I should try or should I use the sIFR method you discussed.

Below is a copy of the ascx file top lines.

<%@ Control language="vb" CodeBehind="~/admin/Skins/skin.vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
<%@ Register TagPrefix="dnn" TagName="BANNER" Src="~/Admin/Skins/Banner.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SOLPARTMENU" Src="~/Admin/Skins/SolPartMenu.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>
<%@ Register TagPrefix="dnn" TagName="CURRENTDATE" Src="~/Admin/Skins/CurrentDate.ascx" %>
<%@ Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/Admin/Skins/BreadCrumb.ascx" %>
<%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
<%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%@ Register TagPrefix="dnn" TagName="DOTNETNUKE" Src="~/Admin/Skins/DotNetNuke.ascx" %>
<script> type="text/javascript"><!--//--><!--

sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i sfEls.onmouseover=function() {
this.className+=" sfhover";
}
sfEls.onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--></script>

Thanks,
Dan
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
12/18/2006 2:53 PM  
Place the javascript at the end of the file. The only javascript that is here is: <script> type="text/javascript"><!--//--><!--[CDATA[/ /><!--

sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i sfEls.onmouseover=function() {
this.className+=" sfhover";
}
sfEls.onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!--]]--></script>

is this all you have entered?
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
D D
Nuke Newbie
Nuke Newbie
Posts:9


--
12/18/2006 4:08 PM  
No sorry, I posted without checking that everything I copied over was in. This is the code I pasted:

<script> type="text/javascript"><!--//--><!--

sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i sfEls.onmouseover=function() {
this.className+=" sfhover";
}
sfEls.onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--></script>
D D
Nuke Newbie
Nuke Newbie
Posts:9


--
12/18/2006 4:17 PM  
Hi Lee,
I tried pasting the following JS code at the end of  my ascx file, but with no luck.

The code to the ascx file is below:

<%@ Control language="vb" CodeBehind="~/admin/Skins/skin.vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
<%@ Register TagPrefix="dnn" TagName="BANNER" Src="~/Admin/Skins/Banner.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SOLPARTMENU" Src="~/Admin/Skins/SolPartMenu.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>
<%@ Register TagPrefix="dnn" TagName="CURRENTDATE" Src="~/Admin/Skins/CurrentDate.ascx" %>
<%@ Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/Admin/Skins/BreadCrumb.ascx" %>
<%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
<%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%@ Register TagPrefix="dnn" TagName="DOTNETNUKE" Src="~/Admin/Skins/DotNetNuke.ascx" %>

<link href="XDFuseMeF.css" rel="stylesheet" type="text/css" />
<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="pagemaster">
  <tr>
    <td>&nbsp;</td>
    <td align="center" valign="top">
    <table  border="0" cellpadding="0" cellspacing="0" width="772">
      <tr valign="top">
        <td colspan="2" valign="top" class="XDFused_04" style="width: 773px; height: 347px">
       
        <table width="100%" height="30"  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="20">&nbsp;</td>
            <td align="left"><span class="LightBG"><dnn:CURRENTDATE runat="server" CssClass="LightBG" id="dnnCURRENTDATE" />
              <span class="Separator"></span> <dnn:USER runat="server" id="dnnUSER" CssClass="LightBG" />
              <span class="Separator"></span> <dnn:LOGIN runat="server" CssClass="LightBG" id="dnnLOGIN" /> </span></td>
            <td align="right"><div class="LightBG">   &nbsp;</div></td><td width="10">&nbsp;</td>
          </tr>
        </table>

          <div class="Logo">
            <dnn:LOGO runat="server" id="dnnLOGO" BorderWidth="0" />
          </div></td>
        </tr>
      <tr>
        <td colspan="2" style="width: 773px" ><table width="100%" height="26"  border="0" cellpadding="0" cellspacing="0">
          <tr>
                <td valign="top" bgcolor="#FFCC33" style="height: 27px">
                  <table width="770" height="23" border="0" align="left" cellpadding="0" cellspacing="0">
        <tr>
                      <td valign="left" bgcolor="ffcc33" style="height: 23px; width: 770px;" align="left"><dnn:SolPartMenu runat="server" id="dnnSolPartMenu" SeparateCss="True" separatorcssclass="mySeparatorClass"/></td>
          </tr>
      </table></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td valign="top" class="LeftPageFull" style="width: 758px" ><table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td id="LeftPane" runat="server" class="leftpane" visible="false" style="height: 19px" width="170"></td>
    <td id="ContentPane" runat="server" class="contentpane" visible="false" style="height: 19px"></td>
  </tr>
  <tr valign="top">
    <td colspan="3" id="BottomPane" runat="server" class="bottompane" visible="false"></td>
  </tr>
</table>
</td>
      </tr>
      <tr>
        <td style="width: 758px"><table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="33" align="center" background="<%= SkinPath %>XDFMPix/LeftFooterFull.jpg"><dnn:TERMS runat="server" CssClass="FooterText" id="dnnTERMS" />&nbsp;&nbsp;<dnnRIVACY  CssClass="FooterText"  runat="server" id="dnnPRIVACY" /></td>
            </tr>
        </table></td>
      </tr>
    </table>     
    </td>
    <td></td>
  </tr>
</table>
<script type="text/javascript"><!--//--><![CDATA[//><!--

sfHover = function() {
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls.onmouseover=function() {
            this.className+=" sfhover";
        }
        sfEls.onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]></script>

Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
12/19/2006 3:03 AM  
and it definitely worked when adding it into the text / html module?

I would try adding it into the default.aspx file then. - Go into the root of your DNN installation files, open the default.aspx file.

Try placing it before the </head> tag

I haven't tried this, DNN may not like it.
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
D D
Nuke Newbie
Nuke Newbie
Posts:9


--
12/19/2006 7:09 AM  
I thought about that too and tried to edit the default.aspx in root by adding the JS above the /head tag. I got an JS error message after editing in ie that may be a clue.

'documentgetElementById(...)' is null or not an object.

I checked back on the JS and found this line that I think is the culprit:

var sfEls = document.getElementById("nav").getElementsByTagName("LI");

I guess the script is looking for "nav" and not finding it. Is there a naming convention that the css should follow to catch the "nav" variable? Right now my css has #houseMenuV as the label for the menu portion. Should that be replaced with "nav"?

And yes the script works if pasted into an html module in IE, so I have that as a back up plan if I can't get the JS script to work.

Thanks,
Dan
Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
12/20/2006 4:13 AM  
Hi Dan,

Yes the 'nav' element could be part of the problem and at a guess it should be replaced by the id you are using for the HouseMenu.

If you look at the code on suckerfish they have used #nav for creating the unordered list element of their menu.

What doesn't make sense is that it works in a text / html module when you don't have any elements on there labeled nav?

Thanks,
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile
D D
Nuke Newbie
Nuke Newbie
Posts:9


--
12/20/2006 9:49 AM  
Hi Lee,
Thanks again for your time on this.
I copied the entire html code including the list of links and css from suckerfish example. And that did work in a text html module, but with some ie spacing issues. The popouts worked.

I changed the #nav reference to #housemenuV, the one that is in the css. That got rid of the JS error message in IE but still no popouts. I then tried replacing the entire housemenu part of my skin css with the one from suckerfish; making sure that #nav was used in the JS code in default.aspx, but still no luck. Also, with this option, you get a bulletted list instead of a menu.

My next guess is that there may be a higher level css, maybe in Portal folder, that is interfering or overiding the skin css file. That or maybe the code in the housemenu css needs to be edited.
I was reading in this tutorial

http://www.htmldog.com/articles/suc...dropdowns/



So now we've got the Suckerfish pumping out new classes, the next step is to simply duplicate the :hover selector with 'sfhover' class selectors:


#nav li:hover ul, #nav li.sfhover ul {
left: auto;
}


I think I may need to add the sfhover line to the housemenu in the right places for it to trigger the JS. Is this the way you read it?

I looked at my housemenu css which I past below for convenience, that there are already sfhover references. Do more need to be added?
#houseMenuV ul { /* all lists */
margin: 0;
padding: 0;
list-style-type: none;
list-style: none;
float: left;
width: 200;
font-family: Arial, Helvetica, Sans-Serif;
font-size: 11px;
color: #FFFFFF;
background-color: #006699;
}

#houseMenuV li { /* all list items */
margin: 0;
padding: 0px;
text-indent: 15px;
list-style-type: none;
list-style: none;
position: relative;
float: left;
width: 200;
/* hack for MacIE5 to ignore, while other browsers use \*/
width: 200px;
_width: 100%; /* width recognized by IE only to handle box model issues */
/* end hack */
line-height : 18px;

}

#houseMenuV li ul { /* second-level lists */
position: absolute;

left: -9999px;
margin-left: 200px;
_margin-left: 200px;
margin-top: -21px;
border: solid 1px #999;
z-index: 999;

}

#houseMenuV li ul ul { /* third-and-above-level lists */
left: -9999px;
z-index: 999;

}

#houseMenuV a {
display: block;
width: 200px;
/* hack for MacIE5 to ignore, while other browsers use \*/
width: 200px;
_width: 100%; /* width recognized by IE only to handle box model issues */
/* end hack */
color: #FFFFFF;
border-bottom: solid 1px #ffcc33;
border-right: solid 1px #ffcc33;
font-weight: bold;
font-color: #FFFFFF;
text-decoration: none;
background-color: #6699;
padding: 0px 0px 0px 0px;
opacity: 1;
filter: progidXImageTransform.Microsoft.Alpha(Opacity=100);
}

#houseMenuV li a:hover {
color: #595050;
background-color: #ffcc00;
}

#houseMenuV li:hover ul ul,
#houseMenuV li:hover ul ul ul,
#houseMenuV li.sfhover ul ul,
#houseMenuV li.sfhover ul ul ul {
left: -9999px;

}

#houseMenuV li:hover ul,
#houseMenuV li li:hover ul,
#houseMenuV li li li:hover ul,
#houseMenuV li.sfhover ul,
#houseMenuV li li.sfhover ul,
#houseMenuV li li li.sfhover ul { /* lists nested under hovered list items */
left: auto;
z-index: 999;
}

#houseMenuV iframe {
position: absolute;
left: 0;
top: 0;
z-index: 0;
filter: progidXImageTransform.Microsoft.Alpha(style=0,opacity=0);
display: block;

}


/* Applied to the parent item, if displayed, in either vertical or horizontal
orientation. Must follow other styles. */
#houseMenuParentItem a
{ /* all links under the parent item (li) */
color: ##ffcc33;
background-color: #339933;
text-decoration: none


}

a#houseMenuParentLink
{ /* parent link itself */
color: #ffffff;
background-color: #339933;
text-decoration: none;
text-indent: 5px;
}

a#houseMenuCurrentLink
{ /* current link itself */
color: #ffffff;
background-color: #339933;
text-decoration: none;
}


Thanks again,
Dan

Lee Sykes
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945


--
12/22/2006 3:13 AM  
Hi Dan,

Have you had any luck yet?

If I was approaching this I would try to simplify it as much as possible until you have a basic version working.

Strip out the code for sub-sub menus and elements such as iframe, currentlink, parent link and just work on code for sub menus - I would strip out as much as possible until you have just the bare bones of the CSS to have a vertical menu, you can work on the styling later. This ensures that none of the current CSS is causing problems.

Then work on one element at a time, the first is getting the submenu to display on hover over.

I would work in Firefox with the web developers toolbar using the techniques outlined here:
http://www.dnncreative.com/Troubles...fault.aspx

This way you can keep experimenting with the CSS until you find the solution.

Thanks,
Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/DNNCreative

Lee Sykes's Facebook Profile


---