Welcome Guest. Sign in or Signup

3. Widgets

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 21, 2012 0 Comments

How to show some custom text in the drop down when there is no match?

In the sample below, a custom text like “No Match Found” is returned when there are no matches found. Note that this code requires the referenced jquery script files as well to be able to run.

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 […]

Posted on April 26, 2012 0 Comments

How to adjust the DatePicker’s dropdown’s Z-Index?

Sometimes the DatePicker will dropdown below your other UI elements in the pages if those elements have a higher Z-Order. So, you will have to adjust the dropdown’s Z-index to make it appear on top. You can do this as follows:

Posted on April 10, 2012 0 Comments

How to disable weekends in a Datepicker dropdown?

You can do so by specifying noWeekends as the function for the beforeShowDay option.

Posted on April 10, 2012 0 Comments

How to highlight special days in the Datepicker dropdown?

You can do so by providing a beforeShowDay event handler as follows: