Iva*_*ich 8 css jquery jquery-ui image draggable
好吧,它变得尴尬,已经搜索并尝试了大约5个小时,我只是在圈子里跑...
场景很简单:它是用户配置文件的标题图像,可以将其拖动到某个位置,然后将图像的顶部位置保存到数据库中.
感谢Beetroot-Beetroot的"遏制:'父母'"我对这段代码感兴趣,实际上我想要它做出反应!除了一个大问题.图片只是跳到顶部或底部.没有平滑的滚动?如果我将"父母"改为"父母",它会很好地滚动但是...当然遏制不再存在了.救命?:d
JS
$(function(){
$(".headerimage").css('cursor','s-resize');
$(".headerimage").draggable({ containment: 'parent', scroll: false, axis: "y", stop: function(event, ui) {
var data = "profileheaderposition="+ui.position.top;
var destination = "/modules/users/profile/save.php";
get_data(data, destination, function(test){
notice(test);
});
}
});
});
Run Code Online (Sandbox Code Playgroud)
所以最后但并非最不重要的是,Header包括在内:
<div class="<?php if ($user->id == $profileuser->id) echo "changer"; ?> ui-corner-all" id="profileheader" style="overflow: hidden; width: 650px; height: 260px; position:relative;">
<?php if($profile->profileheader){
$size = getimagesize($profile->profileheader);
?>
<img id="" class="draggable headerimage" style="position: absolute; top: <?php echo $profile->profileheaderposition; ?>px;" src="<?php echo $profile->profileheader; ?>" alt="profileheader" width="650" />
Run Code Online (Sandbox Code Playgroud)
正如我所说,几个小时的谷歌搜索没有给出任何结果 - 如果我不保存结果它会工作得很好,但哦,好吧......
- 编辑 -
现在我正要哭出来 - 我已经在这个上设置了奖金和帮助我的工具,但在我的网页上有一个来宾帐户:http://www.animize.de
在那里,您可以使用用户名:Gast和pw gast登录页面 - 单击名称(gast)右上角的,您将看到配置文件 - 您可以在那里移动标题图片 - 当然它应该表现得很好用另一种方式 - 帮助:(
| 归档时间: |
|
| 查看次数: |
10278 次 |
| 最近记录: |