MediaWiki:Common.js:修订间差异

来自Mindustry中文wiki
(创建页面,内容为“→‎这里的任何JavaScript将为所有用户在每次页面加载时加载。:​ →‎点击按钮复制内容的脚本:​ $(function() { $('.copy-button').click(function() { var text = $(this).attr('data-text'); var $temp = $("<textarea>"); $("body").append($temp); $temp.val(text).select(); document.execCommand("copy"); $temp.remove(); alert("复制成功!"); }); });”
 
无编辑摘要
第12行: 第12行:
     });
     });
});
});
/* ========== 自定义顶部菜单样式 ========== */
#custom-top-nav {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 20px; /* 距离 Logo 的距离 */
    flex-grow: 1;      /* 让它占据中间的空间 */
}
#custom-top-nav a {
    color: #333;      /* 文字颜色 (如果是深色背景改为 #fff) */
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    padding: 0 15px;  /* 按钮左右间距 */
    line-height: 50px; /* 垂直居中 */
    transition: 0.3s;
    border-radius: 4px;
}
#custom-top-nav a:hover {
    background-color: #eee; /* 鼠标悬停背景色 (深色模式改为 #444) */
    color: #000;            /* 鼠标悬停文字色 */
}

2025年11月29日 (六) 17:30的版本

/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */
/* 点击按钮复制内容的脚本 */
$(function() {
    $('.copy-button').click(function() {
        var text = $(this).attr('data-text');
        var $temp = $("<textarea>");
        $("body").append($temp);
        $temp.val(text).select();
        document.execCommand("copy");
        $temp.remove();
        alert("复制成功!");
    });
});
/* ========== 自定义顶部菜单样式 ========== */
#custom-top-nav {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 20px; /* 距离 Logo 的距离 */
    flex-grow: 1;      /* 让它占据中间的空间 */
}

#custom-top-nav a {
    color: #333;       /* 文字颜色 (如果是深色背景改为 #fff) */
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    padding: 0 15px;   /* 按钮左右间距 */
    line-height: 50px; /* 垂直居中 */
    transition: 0.3s;
    border-radius: 4px;
}

#custom-top-nav a:hover {
    background-color: #eee; /* 鼠标悬停背景色 (深色模式改为 #444) */
    color: #000;            /* 鼠标悬停文字色 */
}