Search Results

Search found 2355 results on 95 pages for 'drag'.

Page 16/95 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • jquery drag and drop script and problem in reading json array

    - by Mac Taylor
    i made a script , exactly like wordpress widgets page and u can drag and drop objects this is my jquery script : <script type="text/javascript" >$(function(){ $('.widget') .each(function(){ $(this).hover(function(){ $(this).find('h4').addClass('collapse'); }, function(){ $(this).find('h4').removeClass('collapse'); }) .find('h4').hover(function(){ $(this).find('.in-widget-title').css('visibility', 'visible'); }, function(){ $(this).find('.in-widget-title').css('visibility', 'hidden'); }) .click(function(){ $(this).siblings('.widget-inside').toggle(); //Save state on change of collapse state of panel updateWidgetData(); }) .end() .find('.in-widget-title').css('visibility', 'hidden'); }); $('.column').sortable({ connectWith: '.column', handle: 'h4', cursor: 'move', placeholder: 'placeholder', forcePlaceholderSize: true, opacity: 0.4, start: function(event, ui){ //Firefox, Safari/Chrome fire click event after drag is complete, fix for that if($.browser.mozilla || $.browser.safari) $(ui.item).find('.widget-inside').toggle(); }, stop: function(event, ui){ ui.item.css({'top':'0','left':'0'}); //Opera fix if(!$.browser.mozilla && !$.browser.safari) updateWidgetData(); } }) .disableSelection(); }); function updateWidgetData(){ var items=[]; $('.column').each(function(){ var columnId=$(this).attr('id'); $('.widget', this).each(function(i){ var collapsed=0; if($(this).find('.widget-inside').css('display')=="none") collapsed=1; //Create Item object for current panel var item={ id: $(this).attr('id'), collapsed: collapsed, order : i, column: columnId }; //Push item object into items array items.push(item); }); }); //Assign items array to sortorder JSON variable var sortorder={ items: items }; //Pass sortorder variable to server using ajax to save state $.post("blocks.php"+"&order="+$.toJSON(sortorder), function(data){ $('#console').html(data).fadeIn("slow"); }); } </script> main part is saving object orders in table and this is my php part : function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $order = $_GET['order']; $order = sql_quote($order); if(empty($order)){ echo "Invalid data"; exit; } global $db,$prefix; if (get_magic_quotes_gpc()) { $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); $_REQUEST = array_map('stripslashes_deep', $_REQUEST); } $data=json_decode($order); foreach($newdata->items as $item) { //Extract column number for panel $col_id=preg_replace('/[^\d\s]/', '', $item->column); //Extract id of the panel $widget_id=preg_replace('/[^\d\s]/', '', $item->id); $sql="UPDATE blocks_tbl SET bposition='$col_id', weight='".$item->order."' WHERE id='".$widget_id."'"; mysql_query($sql) or die('Error updating widget DB'); } print_r($order); now forexample the output is this : items\":[{\"id\":\"item26\",\"collapsed\":1,\"order\":0,\"column\":\"c\"},{\"id\":\"item0\",\"collapsed\":1,\"order\":0,\"column\":\"i\"},{\"id\":\"item0\",\"collapsed\":1,\"order\":1,\"column\":\"i\"},{\"id\":\"item1\",\"collapsed\":1,\"order\":2,\"column\":\"i\"},{\"id\":\"item3\",\"collapsed\":1,\"order\":3,\"column\":\"i\"},{\"id\":\"item16\",\"collapsed\":1,\"order\":4,\"column\":\"i\"},{\"id\":\"item0\",\"collapsed\":1,\"order\":5,\"column\":\"i\"},{\"id\":\"item6\",\"collapsed\":1,\"order\":6,\"column\":\"i\"},{\"id\":\"item17\",\"collapsed\":1,\"order\":7,\"column\":\"i\"},{\"id\":\"item19\",\"collapsed\":1,\"order\":8,\"column\":\"i\"},{\"id\":\"item10\",\"collapsed\":1,\"order\":9,\"column\":\"i\"},{\"id\":\"item11\",\"collapsed\":1,\"order\":10,\"column\":\"i\"},{\"id\":\"item0\",\"collapsed\":1,\"order\":0,\"column\":\"l\"},{\"id\":\"item5\",\"collapsed\":1,\"order\":1,\"column\":\"l\"},{\"id\":\"item8\",\"collapsed\":1,\"order\":2,\"column\":\"l\"},{\"id\":\"item13\",\"collapsed\":1,\"order\":3,\"column\":\"l\"},{\"id\":\"item21\",\"collapsed\":1,\"order\":4,\"column\":\"l\"},{\"id\":\"item28\",\"collapsed\":1,\"order\":5,\"column\":\"l\"},{\"id\":\"item7\",\"collapsed\":1,\"order\":0,\"column\":\"r\"},{\"id\":\"item20\",\"collapsed\":1,\"order\":1,\"column\":\"r\"},{\"id\":\"item15\",\"collapsed\":1,\"order\":2,\"column\":\"r\"},{\"id\":\"item18\",\"collapsed\":1,\"order\":3,\"column\":\"r\"},{\"id\":\"item14\",\"collapsed\":1,\"order\":4,\"column\":\"r\"}]} question is how can i find out column_id or order im a little bit confused

    Read the article

  • how to reference drageventArgs in xaml as command parameter with silverlight

    - by Shaggy
    Hi, on my silverlight 4 app I am trying to link up the drop event on a list box to my viewmodel. I am using expression blend 4's event trigger and invokecommandaction to hook up the drop event. Setting break points on my viewmodel, I can see the relevant function is fired when I drag a file onto the list box, however I cant seem to get access to the drageventArgs. I tried sending the entire listbox as a command parameter, and that doesn't work. Any ideas? Thanks

    Read the article

  • Scriptaculous Draggable/Droppable script not working properly when dragging into a scrolling div

    - by George
    I am using the Scriptaculous Draggable/Droppable scripts and have a problem when dragging into a scrolling div. I have the following layout (based on this question): #grid-container { left:33px; position:relative; width:300px; } #grid { width:310px; height:400px; overflow:auto; margin-bottom: 15px; } #grid-container ul { width:400px; list-style-type:none; white-space: nowrap; } #grid-container li { display:inline; list-style-type:none; padding:5px 15px 5px 15px; height:88px; text-align:center } .image-row { margin-left: 10px; } .grid-image { height:50px; margin-left:-20px; } Here is the html: <div id="grid-container"> <div id="grid"> <div id="row1" class="image-row"> <ul> <li><img id="img1" class="grid-image" src="images/img1.jpg"></li> <li><img id="img2" class="grid-image" src="images/img2.jpg"></li> <li><img id="img3" class="grid-image" src="images/img3.jpg"></li> <li><img id="img4" class="grid-image" src="images/img4.jpg"></li> </ul> </div> <div id="row2" class="image-row"> <ul> <li><img id="img5" class="grid-image" src="images/img5.jpg"></li> <li><img id="img6" class="grid-image" src="images/img6.jpg"></li> </ul> </div> </div> </div> I have another div with draggable items, while all of the img elements are droppable. This works very well for most cases, but when there are too many images for the grid and it has to scroll, I run into issues. I can still drag/drop into most items in that div, but when I scroll down and then try to drag onto an item in the bottom of the list, it drops on the row that was at the bottom before I scrolled the div. Even if I set the scroll attribute when creating the Draggable items, it will scroll the grid div, but not use the proper Droppable item. Is there any way to make the Draggable items drop onto the proper Droppable element regardless of if the containing div is scrolled or not?

    Read the article

  • qt drop event get widget

    - by eyecreate
    I'm trying to, inside a dropevent method, find out which widget was just dropped. I tried looking at the docs, but they only have commands for images and text. How do I access both the item just dropped and which widget it was dropped on?(this is drag and drop inside of a QTreeWidget)

    Read the article

  • Image viewport with zoom in Javascript

    - by pakore
    I want to display a huge image inside a viewport in a html page. I would like to be able to drag and drop the image to move it inside the viewport, like in Google Maps. Any library where I can find such component? Thanks in advance

    Read the article

  • How to trigger binding source update from code in WPF?

    - by Benny
    In My ViewModel class I have a property: class ViewModel { public string FileName {get;set;} } and in my View I bind a label's content to ViewModel's FileName. now When I do drag-drop a file to my View, How can I update the label's Content property, so that the ViewMode's FileName also get updated via binding? Directly set the label's Content property won't work, it just simply clear the binding.

    Read the article

  • Snap to Grid UI in Cappuccino

    - by Grnbeagle
    Does anyone know how to do snap-to-grid in Cappuccino? Basically, I have draggable objects which I can drag into a target area. The target view needs to be set up with snap-to-grid feature. I've seen it with Mockingbird, so it's definitely possible. Any info is appreciated. Thanks!

    Read the article

  • jQuery: Prevent drop propragation over a draggable dialog

    - by Alban
    I have a page with some droppable <td elements and a dialog over the page with some draggable elements. When I drag an element over the dialog that is over a droppable <td, then elements drops inside it even if it is still being dragged over the dialog. Is there any way to prevent drop while the draggable is still over the dialog? For an example, see here: http://www.albanx.com/drop.jpg

    Read the article

  • Data binding manually update in WPF MVVM

    - by Benny
    My ViewModel: class ViewModel { public string FileName {get;set;} } and in my View I bind a label's content to ViewModel's FileName. now When I do drag-drop a file to my View, How can I update the label's Content property, so that the ViewMode's FileName also get updated via binding? Directly set the label's Content property won't work, it just simply clear the binding.

    Read the article

  • how to get dragged event in JQuery UI sortable ?

    - by Sijo
    i am using this jquery to make a drag and drop sortable list. http://jqueryui.com/demos/sortable/ how i can catch the dragged event of elements ? <script> $(document).ready(function() { $("#sortable").sortable(); }); </script> please help me.am not familiar with jquery.thanks in advance..i need to get the id of dragged element.

    Read the article

  • C#, introduce a DragOver delay

    - by user275587
    In my application I catch a DragOver event and then perform an action. I'd like to wait for half a second before performing the action, the action should not be performed after that delay if the drag operation has ended. The only way I could think of to implement this feature is something like this: Function DragOver Event If TimerTimeReached Then PerformDragAction Else If Not TimerStarted StartTimer End End Function Function DragLeave Event If TimerStarted StopTimer End End Function Is there a better way to perform this operation?

    Read the article

  • Visual marker when moving rows on DataGridView

    - by BlueRaja
    Users drag rows up and down in my DataGridView. I have the dragging logic down-pat, but I'd like there to be a dark marker indicating where the row will be placed after I let go of the mouse. (I've seen this in 1000 places before, but can't seem to find an example right now) Does anyone know how I'd go about doing this? Is this built-in, or would I have to draw my own marker (if so, how do I do that)? Thanks!

    Read the article

  • Webkit ondrop event while dragging

    - by monmonja
    I'm trying to drag one img and so it fires ondragenter for IE and dragover event for standard browsers, on IE and FF after the user drags it could fire ondrop event however on Webkit based (chrome and safari), i need to cancel or preventDefault() on the dragover event, doing that so will disable the dragging. Any idea on solving this? Thanks

    Read the article

  • Dragging Controls on Form at runtime

    - by j-t-s
    Hi All I've just started using WPF. But I'm trying to add my code that (from Winforms) enables the user to drag any control whereever they wish at runtime. But I can't seem to get the current Location of the mouse... Eh? There is no Location for Mouse? :(

    Read the article

  • Jquery prevent dragging of text value

    - by ipr101
    I have a html textbox on which I've bound a function via jQuery to the paste event to prevent users pasting a value into the textbox. This functionality works well. However it is possible to select some text from another textbox on the page and drag it into the textbox in which pastes are prevented. Is there a jQuery event that I can bind to that will prevent users dragging text into the texbox?

    Read the article

  • WPF Window Drag/Move Boundary

    - by Sentax
    Hi everyone, just curious if you know of any way to setup a drag boundary for a window? It would be nice to have these properties: Me.MinLeft = 10 Me.MinTop = 10 Me.MaxLeft = 150 Me.MaxTop = 150 Those are made up properties, btw, which would be nice to have. I know I could probably setup a timer to fire ever 10th of a second and check the left and top and then move it back if it's over. But it would be more elegant to have the window act like it hit a wall and can't go any farther, like moving to the edge of the screen or something similar. Edit: There seems to be some confusion somewhere, the point I'm trying to make is in the paragraph above, dragging, not re-sizing.

    Read the article

  • Drag and Drop to a Powershell script

    - by Nathan Hartley
    I thought I had an answer to this, but the more I play with it, the more I see it as a design flaw of Powershell. I would like to drag and drop (or use the Send-To mechanism) to pass multiple files and/or folders as a array to a Powershell script. Test Script #Test.ps1 param ( [string[]] $Paths, [string] $ExampleParameter ) "Paths" $Paths "args" $args I then created a shortcut with the following command line and dragged some files on to it. The files come across as individual parameters which first match the script parameters positionally, with the remainder being placed in the $args array. Shortcut Attempt 1 powershell.exe -noprofile -noexit -file c:\Test.ps1 I found that I can do this with a wrapper script... Wrapper Script #TestWrapper.ps1 & .\Test.ps1 -Paths $args Shortcut Attempt 2 powershell.exe -noprofile -noexit -file c:\TestWrapper.ps1 Has anyone found a way to do this without the extra script?

    Read the article

  • Layer bigger than iPhone bounds : how to drag , pinch it and somm it with my finger

    - by Tibi
    Hi there, I'd like to set up a layer tree containing images. the super layer will be bigger than the iPhone bounds and i'd like the user to drag it with the finger to let him discovering pictures that are out of the screen... is it feasible ? In the same way, I'd like to user to be able to zoom and turn the layer to see more details on images ... I plan to use core animation with layer tree having the super layer holding all images ... Am I on the right path ?

    Read the article

  • Changing drag cursor in VirtualTreeView

    - by Coder12345
    When using VirtualTreeView drag operation by default is [doCopy,doMove]. Move operation is indicated by arrow pointer with small box and Copy operation is indicated by same pointer icon but with added [+] next to it. By default VT uses copy operation and if you press modifier key (SHIFT key) it modifies operation to move therefore removing the [+] from pointer. Here is what I need: reverse the operations (default would be move, with modifier key pressed - copy) and thus reverse pointer arrow too replace modifier key - CTRL instead of SHIFT read in an event which of the two operations occurred and start copy or move operation Any pointers into right direction(s) appreciated.

    Read the article

  • Using ObjectBindingDatasource to bind to object exposing Lists, cant drag and drop fields onto repor

    - by SKM
    Hey Guys Ive used the ObjectBindingDatasource to bind to a class Ive called "ReportViewModel" which contains properties such as List Companies {get; set;} List Managers {get; set;} in its constructor Im just calling a method to populate with dummy data Managers = new ReportDataRepository().GetManagers(); Companies = new ReportDataReposiroty().GetCompanies(); ... When i create the new Datasource , it shows the ReportViewModel class with the Lists under it. I expand the Companies object and attempt draging and dropping fields onto the report designer and it works. Though doesnt allow me to drag and drop for any other List. Any guidance would be really appreciated.

    Read the article

  • jQuery UI: Drag and clone from original div, but keep clones

    - by Nic Hubbard
    I have a div, which has jQuery UI Draggable applied. What I want to do, is click and drag that, and create a clone that is kept in the dom and not removed when dropped. Think of a deck of cards, my box element is the deck, and I want to pull cards/divs off that deck and have them laying around my page, but they would be clones of the original div. I just want to make sure that you cannot create another clone of one of the cloned divs. I have used the following, which didn't work like I wanted: $(".box").draggable({ axis: 'y', containment: 'html', start: function(event, ui) { $(this).clone().appendTo('body'); } });

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >