WEB程序设计-JSP结合CSS控制图片出现的位置
2013-11-02 17:21
585 查看
<%@ 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 Northwest() { var doc=document.getElementById("image").style; //alert(doc.styleFloat); doc.styleFloat="left"; doc.display="block"; var doc2=document.getElementById("image2").style; doc2.display="none"; //doc2.styleFloat="left"; } function Northeast() { var doc=document.getElementById("image").style; doc.display="block"; doc.styleFloat="right"; var doc2=document.getElementById("image2").style; doc2.display="none"; //doc2.styleFloat="left"; } function Southwest() { var doc=document.getElementById("image").style; doc.display="none"; var doc2=document.getElementById("image2").style; doc2.display="block"; doc2.styleFloat="left"; } function Southeast() { var doc=document.getElementById("image").style; doc.display="none"; var doc2=document.getElementById("image2").style; doc2.display="block"; doc2.styleFloat="right"; } function Hidden() { var doc=document.getElementById("image").style; if(doc.visibility!="hidden") doc.visibility ="hidden"; else doc.visibility="visible"; } </script> <style type="text/css"> #div{ text-align: center; } #p{ clear:none; width:320; } #image{ float:right; } #image2{ float:left; display:none; } </style> </head> <body> <div id="div"> <p id="p"> <img alt="图片" src="1.gif" id="image"> 通常比较厚的书籍后面常常附关键词索引表(比如:北京:12, 34页,上海:3,77页……),它能够帮助读者比较快地找到相关内容的页码。而数据库索引能够大大提高查询的速度原理也是一样,想像一下通过书后面的索引查找的速度要比一页一页地翻内容高多少倍……而索引之所以效率高,另外一个原因是它是排好序的。对于检索系统来说核心是一个排序问题。 由于数据库索引不是为全文索引设计的,因此,使用like "%keyword%"时 ,数据库索引是不起作用的,在使用like查询时,搜索过程又变成类似于一页页翻书的遍历过程了,所以对于含有模糊查询的数据库服务来说,LIKE对性能的危害是极大的。如果是需要对多个关键词进行模糊匹配:like"%keyword1%" and like "%keyword2%" ...其效率也就可想而知了。 所以建立一个高效检索系统的关键是建立一个类似于科技索引一样的反向索引机制,将数据源(比如多篇文章)排序顺序存储的同时,有另外一个排好序的关键词列表,用于存储关键词==>文章映射关系,利用这样的映射关系索引:[关键词==>出现关键词的文章编号,出现次数(甚至包括位置:起始偏移量,结束偏移量),出现频率], <img alt="图片" src="1.gif" id="image2">检索过程就是把模糊查询变成多个可以利用索引的精确查询的逻辑组合的过程。 从而大大提高了多关键词查询的效率,所以,全文检索问题归结到最后是一个排序问题。 </p> <input type="button" name="Northwest" value="Northwest" onclick="Northwest()"/> <input type="button" name="Northeast" value="Northeast" onclick="Northeast()"/> <input type="button" name="Southwest" value="Southwest" onclick="Southwest()"/> <input type="button" name="Southeast" value="Southeast" onclick="Southeast()"/> <input type="button" name="Hidden" value="Hidden" onclick="Hidden()"/> </div> </body> </html>
相关文章推荐
- Struts2 访问Action和Jsp页面出现的路径问题解决方案之 ---- 为jsp、图片、js、css等获取Web工程的绝对路径的方法
- CSS中控制背景图片的位置
- 用css控制背景图片的位置,大小
- 用eclipse写web项目中jsp导入图片和css文件的路径问题
- css不兼容情况 background-position在firefox下不兼容,出现图片位置不对,的处理情况;ie6、ie7强制选择器。
- WebView加载图片超过屏幕大小,css控制图片大小
- 用css控制背景图片的位置,大小
- 解决/WEB-INF目录下的jsp页面引入webRoot下的Js、css和图片的问题
- css不兼容情况 background-position在firefox下不兼容,出现图片位置不对,的处理情况;ie6、ie7强制选择器。
- [Web前端技术教学]CSS背景图片位置的百分比解释
- 用css控制背景图片的位置,大小
- ASP.NET Web 开发中的静态资源(JS、CSS、图片)版本控制
- [转]通过css控制背景图片位置-back…
- css控制背景图片位置-background-position
- web前端技术,jquery+css 查看源图片大小
- css+js控制图片展示
- 【Web前端笔记】css让背景图片拉伸填充的属性
- CSS控制背景图片自适应表格大小
- 爱分享 css控制图片垂直水平居中支持IE6、IE7、IE8、FF等…
- CSS控制背景图片随网页或容器自动调整大小