Abbreviated code please
Abbreviated code please
I need code please abbreviate:
Script 1:
- $(document).ready(function (){
- //cache nav
- var nav = $(".pre,.pro");
- //add indicator and hovers to submenu parents
- nav.find("li").each(function() {
- if ($(this).find("ul").length > 0) {
- $("").text("").appendTo($(this).children(":first"));
- //show subnav on hover
- $(this).mouseenter(function() {
- $(this).find("ul").stop(true, true).slideDown();
- });
- //hide submenus on exit
- $(this).mouseleave(function() {
- $(this).find("ul").stop(true, true).slideUp();
- });
- }
- });
- })(jQuery);
Script 2:
- $(document).ready(function (){
- //cache nav
- var nav = $(".form");
- //add indicator and hovers to submenu parents
- nav.find("li").each(function() {
- if ($(this).find("ul").length > 1) {
- $("").text("").appendTo($(this).children(":first"));
- //show subnav on hover
- $(this).mouseenter(function() {
- $(this).find("ul").stop(true, true).slideDown();
- });
- //hide submenus on exit
- $(this).mouseleave(function() {
- $(this).find("ul").stop(true, true).slideUp();
- });
- }
- });
- })(jQuery);