Weird keyboard shortcut behaviour in admin section

Started by MiY4Gi, May 02, 2013, 08:46:39 AM

Previous topic - Next topic

Chen Zhen

MiY4Gi,

  I put the id reference 'topnav' within that js function call because that is how I originally saw it in your source code. Although that was incorrect as it appears it is not the id of the list that goes within that function call but rather some specifics as to how it is to appear (shown in Options on their site).

  Prior to this response, I investigated the script by testing it myself with references from the source. It appears as though using superfish, they intend for it to be put right in the list tags but do not give clear examples with the exact procedure ie. within the first <li> tag which at least would not throw a page error. I was not able to get that superfish method to work as of yet.

  Although I was able to get Brian Cherne's version of the script named hoverIntent to work without any js or page errors. I am not sure if his code produces your desired effect.

Example style sheet. File: /Themes/default/css/superIntent.css

#RESOURCES #main .demo li { padding-bottom: 0; }
ul.demo {display:block; width:100%; height:75px; padding:0; margin:0; background:#9cc; list-style-type:none;}
ul.demo li {background:#fcc; display:block; width:25%; height:50px; padding:0; margin:0; float: left; position:relative; overflow:hidden; cursor:default; font-size:0.9em; line-height:1.1em;}
ul.demo li.p2 {background:#ffc;}
ul.demo li.p3 {background:#cfc;}
ul.demo li.p4 {background:#ccf;}
ul.demo li span { display:block; margin:4px; background:#eef; cursor:default;}


Example index.template.php additional edits:

<link media="screen" rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/superIntent.css?fin20" />
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/jquery-1.9.1.min.js?fin20"></script>
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/jquery.hoverIntent.js?fin20"></script>


same file, prior to the </head> tag: (</head> included for reference)

<script type="text/javascript" charset="utf-8">
        $(document).ready(function(){
            $("#demo1 li").hover(makeTall,makeShort);
            $("#demo2 li").hoverIntent(makeTall,makeShort);
            $("#demo3 li").hoverIntent(toggleHeight);
            $("#demo4").hoverIntent(makeTall,makeShort,"li");
            $("#demo5").hoverIntent(toggleHeight,"li");
            $("#demo6").hoverIntent({
                over: makeTall,
                out: makeShort,
                selector: "li"
            });
        }); // close document.ready

        function makeTall(){$(this).animate({"height":75},200);}
        function makeShort(){$(this).animate({"height":25},200);}
        function toggleHeight(){var h=(parseInt($(this).css("height"),10) > 25) ? 25 : 75; $(this).animate({"height":h},200);}
    </script>
</head>


Finally, for this example the list menu must have id="demo1"

jquery.hoverIntent.js is located here.

  You might be able to experiment with that to get your desired effect (including its css). As I said, as of yet I can not get the superfish jQuery code to work properly.

My SMF Mods & Plug-Ins

WebDev

SMF support staff should be shaping a positive community experience & not provoking an argument or emotional reaction.

Advertisement: