Category ‘JavaScript’ (page 1)

JavaScript Drag and Drop example 3

Monday, 22.02.2010.

School timetable is another example of how to use my Drag and Drop library. Detail description of library can be read on previous post "Drag and drop table content with JavaScript". This example is built on top of two tables: school subjects on the left and timetable on the right.

2 responses so far

JavaScript Drag and Drop example 2

Tuesday, 02.02.2010.

This post shows how to use Drag and Drop library described in my previous post "Drag and drop table content with JavaScript". HTML table is stylized to have left column with content, main table and message line. Elements on the left side (green and orange) should be placed to the coloured table cells. After elements are correctly sited, appropriate message will be displayed.

5 responses so far

Maintain vertical scroll position

Monday, 16.11.2009.

This post describes how to maintain vertical scroll position after form submission or clicking on the link. Script will read vertical scroll position and append scroll value to the URL. After page is loaded, JavaScript function will search for the scroll parameter in the URL and set the scroll position.

No responses yet

JavaScript dialog box

Friday, 28.08.2009.

If you need JavaScript dialog box, and you aren't satisfied with prompt, confirm, alert or window.open, then this page is right for you. Dialog box is emulated with two DIVs. First DIV will overlay whole page (transparency is styled to 60%) while second DIV will be positioned to the page center. That's nothing new but JavaScript code is short, well commented and closed in own namespace (for easier integration with other frameworks).

19 responses so far

NodeList objects in the DOM are live

Thursday, 02.07.2009.

I was surprised when length of collected elements in DOM changed after new node was added. It seems that getElementsByTagName() doesn't return static collection of found elements but a kind of reference to the node list. No, this is not a bug, it's a feature and it has a name: "Live node list".

1 response so far

Autocomplete without AJAX

Wednesday, 17.06.2009.

Today you will find many JavaScript autocomplete solutions. Every JavaScript library has autocomplete functionality but my goal was to create it short and simple as possible. Autocomplete doesn't imply AJAX, and this post shows how to implement autocomplete without AJAX.

No responses yet

Image hover using Javascript

Monday, 08.06.2009.

In this post you will see how to implement image hover with iframe and div. My first try was with div and AJAX. Unfortunately in IE6, select (drop down menu) always stays on top of the hover image. Good old iframe is solution not only to put behind a select element in IE6, but to fetch a content without AJAX.

No responses yet