[jQuery] Suckerfish conversion

[jQuery] Suckerfish conversion


I know there is a lovely suckerfish plugin already. I took it upon myself as
a learning exercise to convert some dom manipulation / css manipipulation
scripts from around the web.
the son of suckerfish dropdown code here
http://www.htmldog.com/articles/suckerfish/dropdowns/example/
uses the following javascript
<script type="text/javascript"><!--//--><![CDATA[//><!--
sfHover = function() {
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]></script>
I attempted to duplicate it with the following ( from the suckerfish plugin
and simply rewriting the son of suckerfish code line by line then
consolidating it. )
        <script type="text/javascript">
            $(document).ready(function(){
                var sfEls = $("#nav li");
                if( document.all ) {
                    sfEls.hover(
                        function(){ $(this).addClass("sfhover"); },
                        function(){ $(this).removeClass("sfhover"); }
                    );
                }
                sfEls.hover(
                    function(){ $(">ul", this).fadeIn("fast"); },
                    function() { }
                );
            });
        </script>
Without the second hover function in there it works fine. It seems to gum up
when I make it prettier by fading the submenu's into view.
In IE i manage to get the first level to drop down, but with what appears to
be some padding / margins / border animation bug. In FF it continues to work
with the animations.
Can someone point out where I am missing this as I am sure it is something
simple. I am sure the newbies around here would appreciate it as I know I
would.
--
View this message in context: http://www.nabble.com/Suckerfish-conversion-tf2297242.html#a6382574
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/