-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode.js
1 lines (1 loc) · 1008 Bytes
/
code.js
1
jQuery("#backtotop").click(function(){jQuery("body,html").animate({scrollTop:0},600)}),jQuery(window).scroll(function(){jQuery(window).scrollTop()>150?jQuery("#backtotop").addClass("visible"):jQuery("#backtotop").removeClass("visible")});$('<form action="#"><select /></form>').appendTo("#mainav"),$("<option />",{selected:"selected",value:"",text:"MENU"}).appendTo("#mainav select"),$("#mainav a").each(function(){var e=$(this);$(e).parents("ul ul ul").length>=1?$("<option />",{value:e.attr("href"),text:"- - - "+e.text()}).appendTo("#mainav select"):$(e).parents("ul ul").length>=1?$("<option />",{value:e.attr("href"),text:"- - "+e.text()}).appendTo("#mainav select"):$(e).parents("ul").length>=1?$("<option />",{value:e.attr("href"),text:""+e.text()}).appendTo("#mainav select"):$("<option />",{value:e.attr("href"),text:e.text()}).appendTo("#mainav select")}),$("#mainav select").change(function(){"#"!==$(this).find("option:selected").val()&&(window.location=$(this).find("option:selected").val())});