java 显示图片预览DIV
来源:互联网 发布:mac du maxdepth 编辑:程序博客网 时间:2024/05/16 07:06
//显示图片预览DIVfunction showpicture(name) {var pathvalue = "";pathvalue = document.getElementById(name).value;if(pathvalue==""){ alert("没有可以预览的图片!");}else{ var len=pathvalue.length; var endstring=pathvalue.substring(len-1,len); if(endstring==",")//用户判断,如果上传的图片串最后一个字符带有','的话,先去掉',',在进行处理; { pathvalue=pathvalue.substring(0,len-1); }var divappends = "";var arrypaht = pathvalue.split(",");for (var i = 0; i < arrypaht.length; i++) {divappends += "<li><a href='"+ arrypaht[i].toString() +"' target='_blank'><img src='" + arrypaht[i].toString() + "' onload='if(this.width>350){this.width = 350;}' border='0'/></a></li>";}if (divappends != "") {document.getElementById("displaypicture").style.display = "block";}document.getElementById("rollList").innerHTML = divappends;}scall();}function scall(){ $("#displaypicture").css("top",document.documentElement.scrollTop+100);}window.onscroll=scall;//关闭图片预览DIVfunction closeshow() {document.getElementById("displaypicture").style.display = "none";}//图片显示效果JS开始var $id = function (id) {return document.getElementById(id);};var scrollHori = {locked:0, vector:0, start:function (thiso) {if (scrollHori.locked == 0) {if (thiso.id == "rollLeft" && $id("rollBox").scrollLeft != 0) {scrollHori.vector = -20;scrollHori.scroll();}if (thiso.id == "rollRight" && $id("rollBox").scrollLeft != ($id("rollList").offsetWidth - $id("rollBox").offsetWidth)) {scrollHori.vector =20;scrollHori.scroll();}}}, scroll:function () {var step = 0;var size = $id("rollList").offsetWidth / $id("rollList").getElementsByTagName("li").length;play = setInterval(function () {if (size > step) {$id("rollBox").scrollLeft += scrollHori.vector;step += Math.abs(scrollHori.vector);scrollHori.locked = 1;} else {scrollHori.stop();}}, 20);}, stop:function () {if (window.play) {clearInterval(window.play);scrollHori.locked = 0;}}};//////////////////////图片显示效果JS结束
0 0
- java 显示图片预览DIV
- 图片预览,图片显示以及图片删除
- Extjs图片上传显示预览
- jQuery上传图片显示预览
- 图片预览自适应固定宽高div
- Ajax,使用div 上传图片预览
- Java上传图片并预览
- ajax在本页面显示预览图片
- 图片上传时,本地显示预览功能
- 图片上传时,本地显示预览功能
- 图片上传时,本地显示预览功能
- 上传图片显示预览js代码
- GridView横向显示 实现图片预览
- 在div中显示图片
- jsp显示本地图片---用户上传显示预览
- 预览显示图片and上传图片保存到image里
- 图片流输出到前台成图片预览显示
- jquery 预览图片,鼠标放上去显示实际大小的预览图片
- 为什么使用Protocol Buffer
- 【iOS开发】音频播放研究
- upload.js 文件图片上传
- Spring事务配置的五种方式和spring里面事务的传播属性和事务隔离级别
- 第52题 Minimum Window Substring
- java 显示图片预览DIV
- 剑指offer 面试题16中 pPrev不应赋为pHead,pReversedHead可以
- cocos2dx音乐音效
- 软件包管理 - RPM and DEB
- mysql 5.6 win7X64 配置
- Ubuntu 下最好用的pdf阅读器okular
- 文件上传类,通用
- 文件上传类,通用
- R语言学习笔记-reshape2