国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
4.1KB

  1. var $ = jQuery;
  2. var thespeed = 5;
  3. var navIE = document.all && navigator.userAgent.indexOf("Firefox") == -1;
  4. var myspeed = 0;
  5. $(function () {
  6. //快捷菜单
  7. bindQuickMenu();
  8. //左侧菜单开关
  9. LeftMenuToggle();
  10. //全部功能开关
  11. AllMenuToggle();
  12. //取消菜单链接虚线
  13. $(".head").find("a").click(function () { $(this).blur() });
  14. $(".menu").find("a").click(function () { $(this).blur() });
  15. }).keydown(function (event) {//快捷键
  16. if (event.keyCode == 116) {
  17. //url = $("#main").attr("src");
  18. //main.location.href = url;
  19. //return false;
  20. }
  21. if (event.keyCode == 27) {
  22. $("#qucikmenu").slideToggle("fast")
  23. }
  24. });
  25. function bindQuickMenu() {//快捷菜单
  26. $("#ac_qucikmenu").bind("mouseenter", function () {
  27. $("#qucikmenu").slideDown("fast");
  28. }).dblclick(function () {
  29. $("#qucikmenu").slideToggle("fast");
  30. }).bind("mouseleave", function () {
  31. hidequcikmenu = setTimeout('$("#qucikmenu").slideUp("fast");', 700);
  32. $(this).bind("mouseenter", function () { clearTimeout(hidequcikmenu); });
  33. });
  34. $("#qucikmenu").bind("mouseleave", function () {
  35. hidequcikmenu = setTimeout('$("#qucikmenu").slideUp("fast");', 700);
  36. $(this).bind("mouseenter", function () { clearTimeout(hidequcikmenu); });
  37. }).find("a").click(function () {
  38. $(this).blur();
  39. $("#qucikmenu").slideUp("fast");
  40. //$("#ac_qucikmenu").text($(this).text());
  41. });
  42. }
  43. function LeftMenuToggle() {//左侧菜单开关
  44. $("#togglemenu").click(function () {
  45. if ($("body").attr("class") == "showmenu") {
  46. $("body").attr("class", "hidemenu");
  47. $(this).html("显示菜单");
  48. } else {
  49. $("body").attr("class", "showmenu");
  50. $(this).html("隐藏菜单");
  51. }
  52. });
  53. }
  54. function AllMenuToggle() {//全部功能开关
  55. mask = $(".pagemask,.iframemask,.allmenu");
  56. $("#allmenu").click(function () {
  57. mask.show();
  58. });
  59. //mask.mousedown(function(){alert("123");});
  60. mask.click(function () { mask.hide(); });
  61. }
  62. function AC(act) {
  63. //alert(act);
  64. mlink = $("a[id='" + act + "']");
  65. if (mlink.size() > 0) {
  66. box = mlink.parents("div[id^='menu_']");
  67. boxid = box.attr("id").substring(5, 128);
  68. if ($("body").attr("class") != "showmenu") $("#togglemenu").click();
  69. if (mlink.attr("_url")) {
  70. $("#menu").find("div[id^=menu]").hide();
  71. box.show();
  72. mlink.addClass("thisclass").blur().parents("#menu").find("ul li a").not(mlink).removeClass("thisclass");
  73. if ($("#mod_" + boxid).attr("class") == "") {
  74. $("#nav").find("a").removeClass("thisclass");
  75. $("#nav").find("a[id='mod_" + boxid + "']").addClass("thisclass").blur();
  76. }
  77. main.location.href = mlink.attr("_url");
  78. } else if (mlink.attr("_open") && mlink.attr("_open") != undefined) {
  79. window.open(mlink.attr("_open"));
  80. }
  81. }
  82. }
  83. /*********************
  84. * 滚动按钮设置
  85. *********************/
  86. function scrollwindow() {
  87. parent.frames['menu'].scrollBy(0, myspeed);
  88. }
  89. function initializeIT() {
  90. if (myspeed != 0) {
  91. scrollwindow();
  92. }
  93. }
  94. //滚动插件
  95. /*
  96. (function($){
  97. $.fn.extend({
  98. Scroll:function(opt,callback){
  99. //参数初始化
  100. if(!opt) var opt={};
  101. var _this=this.eq(0).find("ul:first");
  102. var lineH=_this.find("li:first").height(), //获取行高
  103. line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10), //每次滚动的行数,默认为一屏,即父容器高度
  104. speed=opt.speed?parseInt(opt.speed,10):500, //卷动速度,数值越大,速度越慢(毫秒)
  105. timer=opt.timer?parseInt(opt.timer,10):3000; //滚动的时间间隔(毫秒)
  106. if(line==0) line=1;
  107. var upHeight=0-line*lineH;
  108. //滚动函数
  109. scrollUp=function(){
  110. _this.animate({
  111. marginTop:upHeight
  112. },speed,function(){
  113. for(i=1;i<=line;i++){
  114. _this.find("li:first").appendTo(_this);
  115. }
  116. _this.css({marginTop:0});
  117. });
  118. }
  119. //鼠标事件绑定
  120. var timerID;
  121. timerID=setInterval("scrollUp()",timer);
  122. _this.mouseover(function(){
  123. clearInterval(timerID);
  124. }).mouseout(function(){
  125. timerID=setInterval("scrollUp()",timer);
  126. });
  127. }
  128. })
  129. })(jQuery);
  130. */