Recent Notes
Displaying keyword search results 1 - 10
Created by James on January 26, 2012 21:23:56
Last update: January 26, 2012 21:23:56
In an HTML page, elements can overlap because of position styles. When there's an overlap, elements coming later in the HTML code are displayed on the top. This can be altered by specifying z-index in the CSS. Elements with higher z-index are placed on the top.
However , z-index only works for elements that are not static positioned. Static positioned elements are always at the bottom compared to relative , fixed and absolute positioned elements.
This is a test page:
<!DOCTYPE html>
<html>
<head>
<style t...
Effects of z-index can be tested by adding it to the elements, for example:
<div id="bg" class="big" style="z-index: 3"></div>...
Created by James on March 29, 2011 11:37:53
Last update: March 29, 2011 11:37:53
The test page below reports the column and row indexes of the table cell you clicked.
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by Dr. Xi on August 31, 2008 20:43:44
Last update: January 22, 2011 12:48:08
It's probably more useful to make the JavaScript executor a bookmarklet. That way it gains access to the page on which it is invoked. Therefore, more helpful while debugging. Here's the code:
<html>
<body>
<a href="javascript:(funct...
Or, you can add this link to your bookmarks, name it "JS Executor". For a full featured JavaScript console, you may need Jash
Created by Dr. Xi on October 26, 2010 04:47:37
Last update: January 11, 2011 20:00:36
The code presented here is a simple implementation of a tab set. It is used to demo how a tab set could be implemented. The code is stand alone and does not depend on any JavaScript libraries. Multiple tab sets within the same page is supported.
The HTML markup is fairly simple:
Tabs sets are contained within a DIV element with class name "tabsContainer".
Define a UL list for the tabs.
Follow the UL list with equal number of DIVs for the tab contents.
The Nifty Corners Cube technique is used to draw the rounded corners (original form, not the enhanced JavaScript form).
HTML, CSS and JavaScript:
<!doctype html>
<html>
<head>
<style typ...
Created by Dr. Xi on April 26, 2007 23:00:25
Last update: January 10, 2011 22:15:32
If you ever wonder how those "cool" dialog boxes are made, copy and paste the following code to a file and test it with your browser. This is probably the simplest code for such effects. If you don't know what I mean, try it anyway.
<html>
<head>
<title>Test Overlay</ti...
Created by James on October 29, 2010 20:12:28
Last update: October 29, 2010 20:14:17
Some links for layout managers (the widgets that divide your screen into sections with movable separators, like those normally found in IDEs):
YUI 2: Layout Manager
jQuery UI.Layout Plug-in
Also: http://plugins.jquery.com/project/Layout
jLayout — jQuery plugin
Layout manager - Scripteka :: Prototype extensions library .
Demos: http://javascripts.sourceforge.net/html/layoutmanager/layoutmanager-index.html
Created by James on October 12, 2010 16:17:05
Last update: October 12, 2010 16:18:31
The splice method cuts elements from an array, and returns the cut-off elements as a new array.
a = [1, 2, 3, 4, 5, 6, 7];
b = a.splice(1, ...
Created by James on September 10, 2010 23:01:14
Last update: September 10, 2010 23:01:14
By default, heights for jQuery UI tab panels expand or contract depending on the height of each tab. The code snippet here sets the height of all tabs to be equal to that of the container.
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by Fang on March 23, 2010 03:50:11
Last update: August 18, 2010 21:59:52
This is a simple web application with a single servlet and a single JSP page. It is intended to be a test bed for JSTL tags. You may want to store all syntax, rules, and exceptions in your head, but in my opinion nothing beats a simple test program that allows you play with it all you want. So here it is (build with Maven ). Prerequisites: Maven: http://maven.apache.org/ . You don't need any prior knowledge of Maven, but you need to install the binary. JBoss: http://jboss.org/jbossas/downloads/ , or Tomcat: http://tomcat.apache.org/ if you don't run the SQL tests. You need to know how to deploy a web application (shh! Don't tell your boss it's just copying a file to the deployment folder). Steps: The directory...
Created by James on August 10, 2009 04:02:25
Last update: August 10, 2009 04:16:31
Function Description Examples
length This is actually a property. 'abcd'.length == 4
charAt(int) Return character at given index 'abcd'.charAt(2) == 'c'
(index starts from 0)
indexOf(string) Return first index of given string 'abcdcdcd'.indexOf('cd') == 2
lastIndexOf(string) Return last index of given string 'abcdcdcd'.lastIndexOf('cd') == 6
substring(beginIndex, endIndex) Return substring starting from beginIndex and ending at endIndex 'abcdcdcd'.substring(1, 3) == 'bc'
'abcdcdcd'.substring(1, 300) == 'bcdcdcd'
split(string) Split string into array of strings using given string as delimiter '/home/jsmith/download/js/'.split('/')
==
['', 'home', 'jsmith', 'download', 'js', '']
toLowerCase() Convert string to lower case 'AbCd'.toLowerCase() == 'abcd'
toUpperCase() Convert string to upper case 'AbCd'.toUpperCase() == 'ABCD'