上传图片并将其设置为背景 [英] upload image and set it as background

查看:117
本文介绍了上传图片并将其设置为背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,

我希望我网站上的用户能够通过

hey,

i want my users on my website to be able to change the bodys background image via

Background:


在CSS中.

到目前为止,我有:


in css.

so far i have:

<input type="file" id="file_upload" name="file_upload" />
   <a href="java<!-- no -->script:$('#file_upload').uploadifyUpload();">Upload File</a>


和jQuery


and the jQuery

$(document).ready(function() {
         $('#file_upload').uploadify({
      'uploader'    : '/uploadify/uploadify.swf',
      'script'      : '/uploadify/uploadify.php',
      'cancelImg'   : '/uploadify/cancel.png',
      'folder'      : '/uploads',
	  'sizeLimit'   : 204800,
	  'onComplete'  : function(event, ID, fileObj, response, data) {
      alert('There are ' + data.fileCount + ' files remaining in the queue.');
    }
    });
    });



我想用一个字符串替换警报",这可以做到这一点...
关于下一步的任何想法吗?

p.s
我的服务器支持PHP



i want to replace the ''alert'' with a string which could do this...
any ideas on what to do next?

p.s
My server supports PHP

推荐答案

('#file_upload').uploadifyUpload();" < /a >
('#file_upload').uploadifyUpload();">Upload File</a>


和jQuery


and the jQuery


(文档).ready(
(document).ready(function() {


(#file_upload' ).uploadify({ ' 上传器':' /uploadify/uploadify.swf'' 脚本':' /uploadify/uploadify.php'' cancelImg':' /uploadify/cancel.png'' 文件夹':' /上传"' sizeLimit': 204800 ' onComplete':函数(事件, ID,fileObj,响应,数据){ alert(' 有' + data.fileCount + ' 队列中剩余的文件.'); } }); });
('#file_upload').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/uploadify/uploadify.php', 'cancelImg' : '/uploadify/cancel.png', 'folder' : '/uploads', 'sizeLimit' : 204800, 'onComplete' : function(event, ID, fileObj, response, data) { alert('There are ' + data.fileCount + ' files remaining in the queue.'); } }); });



我想用一个字符串替换警报",这可以做到这一点...
关于下一步的任何想法吗?

p.s
我的服务器支持PHP



i want to replace the ''alert'' with a string which could do this...
any ideas on what to do next?

p.s
My server supports PHP


这篇关于上传图片并将其设置为背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆