How do I get the coordinate position after using jQuery drag and drop?

I just made something like that (If I understand you correctly). I use he function position() include in jQuery 1.3.2. Just did a copy paste and a quick tweak… But should give you the idea. // Make images draggable. $(“.item”).draggable({ // Find original position of dragged image. start: function(event, ui) { // Show start dragged … Read more

What are the CSS properties that get elements out of the normal flow?

Only the following properties affects the normal flow of any given element: float: right|left position: absolute|fixed Just for completeness: display: none removes the element from the flow (strictly speaking the element will not have a flow order) position: relative does not change the flow order of the element, but changes its position relative to the … Read more

Generate paired stacked bar charts in ggplot (using position_dodge only on some variables)

One workaround would be to put interaction of sample and name on x axis and then adjust the labels for the x axis. Problem is that bars are not put close to each other. ggplot(df, aes(x = as.numeric(interaction(sample,name)), y = count, fill = type)) + geom_bar(stat = “identity”,color=”white”) + scale_x_continuous(breaks=c(1.5,3.5,5.5),labels=c(“oak”,”birch”,”cedar”)) Another solution is to use … Read more

How to move the cursor or simulate clicks for other applications?

You’ve inspired me to refactor some of my automation code: NativeMethods.cs – got most of this from online: using System; using System.Runtime.InteropServices; public class NativeMethods { [DllImport( “user32.dll”, SetLastError = true )] internal static extern Int32 SendInput( Int32 cInputs, ref INPUT pInputs, Int32 cbSize ); [StructLayout( LayoutKind.Explicit, Pack = 1, Size = 28 )] internal … Read more

Finding number position in string

With help of xdazz answer, I did some changes and got answer finally… SELECT myWord, LEAST ( if (Locate(‘0’,myWord) >0,Locate(‘0’,myWord),999), if (Locate(‘1’,myWord) >0,Locate(‘1’,myWord),999), if (Locate(‘2’,myWord) >0,Locate(‘2’,myWord),999), if (Locate(‘3’,myWord) >0,Locate(‘3’,myWord),999), if (Locate(‘4’,myWord) >0,Locate(‘4’,myWord),999), if (Locate(‘5’,myWord) >0,Locate(‘5’,myWord),999), if (Locate(‘6’,myWord) >0,Locate(‘6’,myWord),999), if (Locate(‘7’,myWord) >0,Locate(‘7’,myWord),999), if (Locate(‘8’,myWord) >0,Locate(‘8’,myWord),999), if (Locate(‘9’,myWord) >0,Locate(‘9’,myWord),999) ) as myPos FROM myTable; Demo

Creating a collapsed range from a pixel position in FF/Webkit

Here is my implementation of caretRangeFromPoint for old browsers: if (!document.caretRangeFromPoint) { document.caretRangeFromPoint = function(x, y) { var log = “”; function inRect(x, y, rect) { return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom; } function inObject(x, y, object) { var rects = object.getClientRects(); for (var i … Read more

SVG Positioning

Everything in the g element is positioned relative to the current transform matrix. To move the content, just put the transformation in the g element: <g transform=”translate(20,2.5) rotate(10)”> <rect x=”0″ y=”0″ width=”60″ height=”10″/> </g> Links: Example from the SVG 1.1 spec