nmoa Posted August 29, 2016 at 03:21 PM Report #598453 Posted August 29, 2016 at 03:21 PM boas Qual o problema aqui do each? ele está-me a dar 2 resultados em vez de ser só um $(".dd-handle").each( function(e) { console.log(e); } o php esta assim (...) <?php while ($img= mysql_fetch_array($imagens)){ echo '<li data-id="'.$img["ordem"].'" class="dd-item"> <div class="dd-handle" data-ordem="'.$img["ordem"].'">ordem: '.$img["ordem"].'</div> <img src="./uploads/'.$img["file"].'" width="100px" class="data-dz-thumbnail" /> <br> <div class="btn-group"> <button style="padding:2px" type="button" onClick="apagar('.$img["id_imovel_imgs"].')" class="btn btn-danger btn-block-sm"><i class="fa fa-times"></i></button> </div> </li>'; } ?> obrigado
KTachyon Posted August 29, 2016 at 03:36 PM Report #598455 Posted August 29, 2016 at 03:36 PM É uma boa pergunta. Não me parece que estejas a fornecer informação suficiente para se conseguir perceber o problema. “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -- Tony Hoare
nmoa Posted August 29, 2016 at 03:39 PM Author Report #598456 Posted August 29, 2016 at 03:39 PM o codigo completo dessa página está assm <?php require_once("../connect.php");connect(); $imagens= mysql_query("SELECT * FROM imovel_imgs where id_imovel=".$_GET["id"].""); $contagem= mysql_num_rows($imagens); if ($contagem>0){ echo '<div class="ativo">'; }else { echo '<div class="resposta">'; } ?> <h4>Imagens Inseridas</h4><br> <div id="nestable" class="dd mb35"> <ol class="dd-list"> <?php while ($img= mysql_fetch_array($imagens)){ echo '<li data-id="'.$img["ordem"].'" class="dd-item"> <div class="dd-handle" data-ordem="'.$img["ordem"].'">ordem: '.$img["ordem"].'</div> <img src="./uploads/'.$img["file"].'" width="100px" class="data-dz-thumbnail" /> <br> <div class="btn-group"> <button style="padding:2px" type="button" onClick="apagar('.$img["id_imovel_imgs"].')" class="btn btn-danger btn-block-sm"><i class="fa fa-times"></i></button> </div> </li>'; } ?> </ol> </div> <?php echo '</div>'; ?> <script> $(document).ready (function (){ "use strict"; // Init Theme Core Core.init(); var imovel="<?php echo $_GET["id"] ;?>"; $('#nestable').nestable().on('change', function (){ $(".dd-handle").each( function(e) { console.log(e); $.post('entrada.php?page=26',{ 'imovel' : imovel, 'ordem_imagem' : e }); }); }); }); </script>
nmoa Posted August 29, 2016 at 05:08 PM Author Report #598459 Posted August 29, 2016 at 05:08 PM ja consegui faltava colocar um return false; obrigado
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now