Witam.
Mam skrypt Drag & Drop który wykorzystuje dane pobrane z bazy danych. I nie wiem jak po zmianie kolejności (po kliknięciu na przycisk) zapisać nową kolejność w bazie danych.
Przeszukałem wszystkie podobne tematy na tym i innych forach gdzie nie znalazłem jasnej odpowiedzi.
<script type="text/javascript"> var controls, s;
window.addEvent('domready', function(){
//s = new Sortables($('list-1'), {
//s = new Sortables('list-3', {
s = new Sortables(['list-3'], {
cloneOpacit:.2,
handl: 'span',
clon: $('clone-box').checked,
rever: $('revert-box').checked,
constrai: $('constrain-box').checked,
initializ: function(){
this.element.scrollTo(0, y);
this.addEvent('onStart', function(){ this.scroller.start(); });
this.addEvent('onComplete', function(){ this.scroller.stop(); });
}
});
controls = new Fx.Slide('controls').hide();
});
<div style="margi: 0px; overflo: hidden; heigh: 0px;"><div style="margi: -166px 0px 0px;" id="controls"> <label for="clone-box">clone elemen:
<input id="clone-box" checked="checked" onchange="s.options.clone = this.checked" type="checkbox"></label> <label for="revert-box">revert effec:
<input id="revert-box" checked="checked" onchange="s.options.revert = this.checked" type="checkbox"></label> <label for="constrain-box">constrai:
<input id="constrain-box" onchange="s.options.constrain = this.checked" type="checkbox"></label>
<?php while ($buddies = mysql_fetch_array($fetch_buddies)) { ?>
<div id="<?php echo $buddies['buddy_id'];?>" style="wi:70px; hei:80px;" align="center">
<img height="64" width="64" src="<?php echo user_picture($buddies['buddy_buddy']);?>" />
<a class="tooltiph" style="font-s:9px;" href="profil.php?username=<?php echo $buddies['buddy_buddy'];?>">
<?php echo $buddies['buddy_buddy'];?></a>
<?php } } ?>
#lists ul { floa:left; }
#list-3 { }
#list-3 div { floa:left; }
Ciekawy linkNie wiem za bardzo jak z tego skorzystać i podczepić pod swój skrypt.
Ten post edytował DITRID 20.09.2008, 14:54:50