给网站添加鼠标点击弹出指定汉字特效
JavaScript代码12345678910111213141516171819202122232425262728/* 鼠标特效 */var a_idx = 0;jQuery(document).ready(function ($) { $("body").click(function (e) { var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善"); var $i = $("").text(a[a_idx]); a_idx = (a_idx + 1) % a.length; var x = e.pag ...
实现鼠标移动到div块时自动加阴影效果
HTML代码123<div class="shadow"> //已省略无关代码</div>
CSS代码1234567891011.shadow { float: left; margin-left: 20px; transition-duration: 0.5s; /*停留时间显示*/} .shadow:hover { -webkit-box-shadow: #337ab7 0px 10px 10px; -moz-box-shadow: #337ab7 0px 10px 10px; box-shadow: #337ab7 0px 5px 5px;}
效果
PS.来源:css怎么实现鼠标移动到div块时自动加阴影效果?_tenggeer0789的博客-CSDN博客
遍历HashMap的四种方法
创建HashMap集合1234HashMap<Integer, String> hashMap = new HashMap<>(16);hashMap.put(1, "a");hashMap.put(2, "b");hashMap.put(3, "c");
遍历keySet()使用keySet()方法,先遍历键,再取出值
123for (Integer key : hashMap.keySet()) { System.out.println("key=" + key + ",value=" + hashMap.get(key));}
values()使用values()方法,直接遍历值
123for (String value : hashMap.values()) { System.out.println(value);}
entrySet()使用entrySet()方法,然后通过getKey()和get ...
实现鼠标移到图片改变,移出图片恢复原来图片
HTML代码1234<a class="imgdiv" href="#gotop" title="返回顶部"> <img th:src="@{/static/images/top2.png}" id="gotop" alt="" class="imgsrc" style="position: fixed;bottom: 10%;display: none;height: 40px;margin-left: 96%"></a>
JavaScript代码12345678$(document).ready(function () { $(".imgdiv").mouseover(function(){ $(".imgsrc").attr("src",&quo ...
IntelliJ IDEA版本更新
下载JetBrains: 软件开发人员和团队的必备工具
卸载可以先保存当前idea配置(查看链接:idea导出配置和导入配置的方法)
找到idea安装目录下的bin文件夹的Uninstall.exe并点击开始卸载
勾选下图中的选项,只勾选划红线的第一个选项,不要勾选第二个(不然新版本安装后无法读取原来配置和插件),然后开始卸载等待完成即可
安装
选择安装路径
配置,然后点击下一步安装即可
导入配置
前端实现返回顶部
HTML代码123<a href="#gotop" title="返回顶部"> <img th:src="@{/static/images/top2.png}" id="gotop" alt="" style="position: fixed;bottom: 10%;display: none;height: 40px;margin-left: 96%"></a>
JavaScript代码12345678910111213141516//返回顶部图标出现或者消失$(function () { $(function () { $(window).scroll(function () { if ($(window).scrollTop() > 100) { $("#gotop&quo ...
Thymeleaf常用属性总结
th:text用于显示转义后的文本(不尊重我们的HTML标记而对其进行转义)
1th:text="${blog.title}"
截取字符串1th:text="${#strings.abbreviate(blog.title,18)}"
格式化时间1th:text="${#dates.format(blog.releaseDate,'yyyy-MM-dd HH:mm:ss')}"
th:utext用于显示未转义的文本(尊重我们的HTML标记而不对其进行转义)
1th:utext="${blog.content}"
th:if条件判断,条件成立则在页面中显示,不成立则不显示
1th:if="${blog!=null}"
th:each循环语句,如果要显示一个List集合的所有内容则使用循环遍历,下面代码中blogList代表要循环遍历的集合,blog则代表集合中的 ...
Java从键盘输入的三种方法
System.in的read方法这种方式极其简单,但是只能读入一个字符,且必须是字符类型,输出该字符的ASCII码。(如果输入字符串,则指能读入第一个字符,在下面的截图中可以看到:输入ab时输出了97,那么我们可以判断出只能读入第一个字符,因为a的ASCII码是97)
1234public static void main(String[] args) throws IOException { int i = System.in.read(); System.out.println(i);}
InputStreamReader和BufferedReader方法这种方式可以读取一个字符串,但是如果需要读取int,float等类型仍需要自己转换
123456public static void main(String[] args) throws IOException { InputStreamReader is = new InputStreamReader(System.in); BufferedReader br = new ...
Spring Boot引入Thymeleaf
引入依赖1234<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>
application.yml配置123spring: thymeleaf: cache: false
HMTL页面修改找到html标签头部<html>,一般在.html文件第二行
修改前1<html lang="en">
修改后1<html lang="en" xmlns:th="http://www.thymeleaf.org">
为了让HTML代码页面变得美观,可加入<!--suppress ALL-->抑制所有警告(html标签头部<html>前加入即可)
至此,Spring Boot引入Thymel ...
JavaScript实现点击图片查看原图
代码HTML代码:1234567<div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;"> <div id="innerdiv" style="position:absolute;"> <img id="bigimg" style="border:5px solid #fff;" src=""/> </div> <h1 style="color: yellow;text-align: center">************************点击图片外任何区域即可关闭图片************************</ ...