jQuery按钮切页样式
发布日期:2022-03-04 12:48:41 浏览次数:23 分类:技术文章

本文共 972 字,大约阅读时间需要 3 分钟。

字体颜色:#337ab7

背景颜色:#1890ff

#nav {
width: 100%; height: 40px; margin: 10px 0; font-size: 14px; overflow: hidden; white-space: nowrap; border-bottom: 2px solid #1890ff;}#nav a {
display: inline-block; height: 40px; line-height: 40px; padding: 0 10px; text-decoration: none; border-radius: 4px 4px 0 0; color: #23527c; cursor: pointer;}#nav a:first-child {
background: #1890ff; color: #fff;}
// 切页改变样式$("#nav a").click(function () {
$("#nav a").css({
"background": '#fff', "color": '#337ab7'}) $(this).css({
"background": '#1890ff', "color": '#fff'}) })// 鼠标移入样式$("#nav a").hover(function () {
if ($(this).css('color') !== 'rgb(255, 255, 255)') {
$(this).css({
"background": '#eeeeee', "color": ' #23527c'}) } }, function () {
if ($(this).css('color') !== 'rgb(255, 255, 255)') {
$(this).css({
"background": '#fff', "color": '#337ab7'}) } })

在这里插入图片描述

转载地址:https://blog.csdn.net/qq_44308920/article/details/121536173 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:jQuery读取Table表格数据
下一篇:bootstrapTable自定义表头模板

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年04月04日 00时16分54秒