Welcome Guest. Sign in or Signup

Common

Posted on July 31, 2012 1 Comments

How to draw lines at an angle?

HTML doesn’t have a direct way to draw a line (unless you are inside a Canvas or SVG object), however you can use a div with a specific height and 0 width to get a vertical line (or vice versa for a horizontal line). Then apply a transform on the div-line to draw it at […]

Posted on July 5, 2012 1 Comments

How to Auto Scroll a div on mouse move over the margins?

One way to do this is to use a timer, in whose tick event, we can scroll the div little bit at a time. Start this timer when the mouse is hovering over the margins and stop it when the mouse is outside the margins.

Posted on June 27, 2012 1 Comments

How to show a simple busy indicator while doing a long operation?

You can use an animated gif like below to indicate a long operation, encouraging the user to wait. For the below code to work, update the url in the ajax call below to a valid url.

Posted on May 21, 2012 0 Comments

How to build tab like UI using anchors and divs?

The following example uses 3 anchor tags each bound to a some content enclosed within divs. Clicking on these tags will show the corresponding div and hide the others. Note the use of “window.location.hash” to save the last selected anchor to ensure that page refreshes continues to show the latest shown content.

Posted on May 16, 2012 0 Comments

How 2 synchronize the vertical scroll bar of 2 divs?

jQuery’s scroll event makes it very simple to synchronize the vertical scroll bar of 2 divs.

Posted on May 15, 2012 1 Comments

How to force passing, as widget option, java script objects by reference rather than as values/copies?

By default, when you pass a simple java script object as an option to a widget, jQuery will actually create a copy of the object within the widget creation code. This is usually fine unless you want to pass it by reference so that you can know the changes made to the object within the […]