我正在使用jcrop进行图像裁剪,并希望用户可以选择在开始裁剪之前更改图像.
出于某种原因,我无法改变图像.
jsfiddle http://jsfiddle.net/UUKP4/2/
当我查看firefly中的代码时,它会显示两个img元素,另一个位于没有id的jcrop容器中.
我怎样才能改变图像?
码
#jcrop_target {
width:200px;
}
$(function () {
$('#jcrop_target').Jcrop();
});
function chageImage() {
alert("hello");
$('#jcrop_target').attr('src', 'http://eofdreams.com/data_images/dreams/cat/cat-06.jpg');
}
<img src="http://jcrop-cdn.tapmodo.com/v0.9.10/demos/demo_files/pool.jpg" id="jcrop_target" />
<input type='button' value='change image' id='changeImage' onclick='chageImage();'>
Run Code Online (Sandbox Code Playgroud) 我正在尝试实现频谱颜色选择器http://bgrins.github.io/spectrum/
我有频谱css文件和频谱js文件以及与html文件在同一文件夹中的jquery 1.9.0文件.
我得到的只是屏幕上的输入框,没有颜色选择器.我试过firefox/chrome和IE但没什么.
我无法看到它说我需要任何其他文件的任何地方
任何人都可以请求帮助,因为我认为它可能是非常明显的
这是html文件的代码
<!DOCTYPE html>
<html>
<meta charset="utf-8" />
<head>
<link rel="stylesheet" type="text/css" href="spectrum.css ">
<script type="text/javascript" src="jquery-1.9.0.js"></script>
<script type="text/javascript" src="spectrum.js"></script>
<script>
$(".my_color").spectrum({
color: "#f00"
});
</script>
</head>
<body>
<input type='text' class="my_color" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我试图把手放在4边和4角的jquery resiazble盒子上.
我可以让他们在四边没有问题和顶角但由于某种原因,底角正在上升,我无法看到我的生活我做错了什么.
底部边框有一个第二个边框,其中一些其他符号显示,而且调整大小的句柄不在那里.光标也是整个底部边框上的SW
任何帮助非常感谢
继承我的代码
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Resizable - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>
#resizable {top:150px;left:150px; width: 150px; height: 150px; padding: 0.5em; }
#resizable h3 { text-align: center; margin: 0; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 10px; width: 100%; top: 0px; left: 0; background: url(resize-handle.gif) top center no-repeat; border-top: 1px solid #f00;}
.ui-resizable-s { cursor: s-resize; height: …Run Code Online (Sandbox Code Playgroud) 我正在尝试基于此水平滚动方法创建一个站点响应水平页面滑动
我希望导航栏在第一页上垂直居中,但在其他页面上移动到顶部.
示例:http://jsfiddle.net/wtvaJ/26/
我有这个工作,但我希望导航栏动画并在单击另一个页面时平滑滚动到顶部.我试过这样做
$('.navbar').animate({scrollTop:50},500);
Run Code Online (Sandbox Code Playgroud)
但没有变化.我知道它的代码不错,因为它没有破坏我的jquery函数,但我也知道它不正确,因为它不起作用.
有没有人知道如何实现这一目标?
所有输入都非常感谢
下面是与jsfiddle相匹配的代码
HTML
<div class="wrapper">
<div class="nav">
<a href="#page-1" class="scrollitem selected">page 1</a>
<a href="#page-2" class="scrollitem">page 2</a>
<a href="#page-3" class="scrollitem">page 3</a>
</div>
<div id="page-1" class="page">
<h3>page 1</h3>
<div class="simulate">Simulated content heigher than 100%</div>
</div>
<div id="page-2" class="page">
<h3>page 2</h3>
<div class="simulate">Simulated content heigher than 100%</div>
</div>
<div id="page-3" class="page">
<h3>page 3</h3>
<div class="simulate">Simulated content heigher than 100%</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
JS
$(document).ready(function () {
var sildeNum = $('.page').length,
wrapperWidth = 100 …Run Code Online (Sandbox Code Playgroud) 我希望页面顶部的div不会移动,但我希望下面的页面的其余部分可以滚动.滚动条只能从div下方开始.
这可能不使用框架
提前致谢
我正在从MySQL数据库加载动态创建的网页.
我正常设置页面但是当我到达页面的内容部分时,我运行一个while循环并根据存储在数据库中的内容加载页面元素.
这对我很有用,除非我加载的条纹是根据正文而不是内容定位的,并且宽度为页面的100%而不是100%的内容.
有没有办法用jquery或javascript定位条带元素,所以它们是相对于正文.
数据库中的每个元素都有顶部和左侧的位置,并且具有高度和宽度,以及更多的东西,如边界等.
我在div中加载元素并将css设置为内联,就像这样
<div id="shape" style="position:absolute;top:<? echo $row['box_top']; ?>px;left:<? echo $row['box_left']; ?>px;height:<? echo $row['box_height']; ?>px;width:100%;z-index:<? echo $row['zindex']; ?>;border-top-width:<? echo $row['border_width']; ?>px;border-bottom-width:<? echo $row['border_width']; ?>px; border-style:<? echo $row['border_style']; ?>;padding:<? echo $row['padding']; ?>; opacity:<? echo $row['image_opacity']; ?>;filter:alpha(opacity=<? echo $ieopacity; ?>)"><? echo $row['content']; ?></div>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我有一个php页面,它接收用户图像并将其上传到我的网络服务器.
我刚刚注意到,如果我有一个透明背景的png,并上传它,背景将变为白色.
例如,我在具有透明背景的photoshop中创建新图像,然后在页面中添加彩色圆圈.我通过ftp将图像保存为png和uplod到服务器,然后图像在网页上显示为圆形,因为背景是透明的.
如果我使用带文件输入框的php上传图像,图像将变为白色.
我曾尝试使用imagealphablending,imagecolorallocatealpha,imagefill和imagesavealpha来保留透明背景,但它只是将bg更改为黑色.
任何线索?
继承我的PHP代码
<?php
$path = "../userfiles/orig/";
$userpath="../".$_REQUEST['userpath']."/";
function getExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}
$valid_formats = array("jpg", "png", "gif", "bmp","jpeg","PNG","JPG","JPEG","GIF","BMP");
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
$name = $_FILES['photoimg']['name'];
$size = $_FILES['photoimg']['size'];
if(strlen($name)){
$ext = getExtension($name);
if(in_array($ext,$valid_formats)){
if($size<(2048*2048)){
$time1=time();
$actual_image_name =$time1."_".str_replace(" ", "_", $name);
$tmp = $_FILES['photoimg']['tmp_name'];
if(move_uploaded_file($tmp, $path.$actual_image_name)){
$image=$actual_image_name;
/*--------resize image-----------*/
$size = 320; // the imageheight
$filedir = …Run Code Online (Sandbox Code Playgroud) jquery ×5
css ×4
html ×4
javascript ×3
color-picker ×1
gd ×1
handles ×1
image ×1
jcrop ×1
php ×1
resizable ×1
transparency ×1