JS完成改变新闻字体大中小的显示
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function changeStyle(style){
alert(style);
var divNode = document.getElementById("newsid");
divNode.className = style;
} </script>
<style type="text/css">
.fontBig{
color: #0000CC;
font-size:24px;
font-family: serif;
}
.fontMedi{
color: #FF0000;
font-size: 16px;
font-family: sans-serif;
}
.fontSmall{
color: yellow;
font-size: 4px;
font-family: inherit;
}
</style>
</head> <body>
<H2>新闻标题</H2> <br/>
<a href="javascript:void(0)" onclick="changeStyle('fontBig')">大字体</a> ||
<a href="javascript:void(0)" onclick="changeStyle('fontMedi')">中字体</a> ||
<a href="javascript:void(0)" onclick="changeStyle('fontSmall')">小字体</a> <br/>
<div id="newsid" >
新闻新闻新闻新闻新闻<br/>新闻新闻新闻新闻新闻
</div> <input type="button" onclick="demo()" value="点点">
</body>
</html>
JS完成改变新闻字体大中小的显示的更多相关文章
- 《项目经验》--后台一般处理程序向前台JS文件传递JSON,JS解析JSON,将数据显示在界面--显示在DropDownList 或 显示在动态创建的table中
http://blog.csdn.net/mazhaojuan/article/details/8599167 先看一下我要实现的功能界面: 这篇文章主要介绍:后台一般处理程序把从数据库查找的数据,转 ...
- js基础--浏览器标签页隐藏或显示状态 visibility详解
欢迎访问我的个人博客:http://www.xiaolongwu.cn 前言 在工作中我们可能会遇到这样的需求,当浏览器切换到别的标签页或着最小化时,我们需要暂停页面上正在播放的视频或者音乐,这个需求 ...
- BootStrap字体图标不显示、下拉菜单不显示
在W3CSchool学习BootStrap教程时遇到的问题…… 1.字体图标不能显示 上面是正常显示的样子,不能正常显示,因为缺少下面的字体图标样式文件 (1)在下载的Bootstrap包中将font ...
- Android代码中设置字体大小,字体颜色,显示两种颜色.倒计时效果
Android代码中设置字体大小,字体颜色,显示两种颜色 在xml文件中字体大小用的像素 <TextView android:id="@+id/uppaid_time" an ...
- vue iView 打包后 字体图标不显示
问题描述: 今天webpack打包后发现iView 字体图标不显示 解决方案: build/webpack.prod.conf.js 这个文件里面 module: { rules: utils.sty ...
- webpack打包绝对路径引用资源和element ui字体图标不显示的解决办法
webpack打包绝对路径引用资源解决办法: 打开webpack.prod.conf.js 找到output:增加 publicPath: './', 即可,如图 element ui字体图标不显 ...
- linux终端c语言改变输出字体颜色
Linux下C改变输出字体颜色 例: #include int main() { printf("\033[31mThis is RED.\n\033[0m"); return 0 ...
- js控制 固定框架内图片 按比例显示 以及 占满框架 居中显示
js控制 固定框架内图片 等比例显示 以及 占满框架 纵横居中显示 通过设置 js函数 fitDiv里面var fit的值就好 function fitDiv (obj) { var target_w ...
- atitit js 开发工具 ide的代码结构显示(func list) outline总结
atitit js 开发工具 ide的代码结构显示(func list) outline总结 eclips环境::4.3.1 #-------需要一个js开发工具,可以显示outline或者代码结构显 ...
随机推荐
- Ubuntu检测磁盘是否挂载
Ubuntu默认不自动挂载磁盘. 只是学习Bash使用,需优化如使用 # file: mountAll.sh # include color support # a list of variables ...
- Linux和Windows远程桌面互连
1.Ubuntu 连 windows W.1 Windows设置允许远程桌面连接 U.1 Ubuntu设置 apt-get install rdesktop U.2 Ubuntu连接 ...
- C#:控制WinForm界面的显示
控制WinForm界面在屏幕的四个角落显示,具体代码中有说明: using System; using System.Collections.Generic; using System.Drawing ...
- 多校3- RGCDQ 分类: 比赛 HDU 2015-07-31 10:50 2人阅读 评论(0) 收藏
RGCDQ Time Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practic ...
- 《python核心编程》读书笔记--第15章 正则表达式
15.1引言与动机 处理文本和数据是一件大事.正则表达式(RE)为高级文本匹配模式,为搜索-替换等功能提供了基础.RE是由一些字符和特殊符号组成的字符串,它们描述了这些字符和字符串的某种重复方式,因此 ...
- fg、bg、jobs、&、ctrl + z
原文地址:fg.bg.jobs.&.ctrl + z 作者:china-yuan http://blog.chinaunix.net/uid-22433093-id-1774026.html ...
- Linux 线程与进程,以及通信
http://blog.chinaunix.net/uid-25324849-id-3110075.html 部分转自:http://blog.chinaunix.net/uid-20620288-i ...
- MySQL 数据库发展历程及缺点
传统关系数据库的瓶颈 传统的关系数据库具有不错的性能,高稳定型,久经历史考验,而且使用简单,功能强大,同时也积累了大量的成功案例.在互联网领域,MySQL成为了绝对靠前的王者,毫不夸张的说,MySQL ...
- linux poll 学习
一.poll介绍 函数原型: #include <poll.h> int poll(struct pollfd *fds, nfds_t nfds, int timeout); struc ...
- NOIP 营业额统计 splay tree 纯模板
2924: 营业额统计 Time Limit(Common/Java):1000MS/3000MS Memory Limit:65536KByteTotal Submit: 389 ...