Archive for June, 2005

Some Drawings of My Wife

Lord Ganesha
Lord Ganesha

Simple way of reloading a page

self.location = self.location;

Another Way of Loading IFrame dynamically

This is yet another way of loading an iFrame dynamically using javascript.


function loadIframe(iframeName, url) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
}
else return true;
}

To load an doc inside a iframe dynamically

We can load a document into an iframe dynamically by using iframe.src = “yourpage” in javascript.
But this works well in IE and not in others browsers. Here is an method to load iframes dynamically.

I found this at http://developer.apple.com/internet/webcontent/iframe.html and just changed something to fit our need.


var IFrameObj;
function loadIFrame(thePage){
//loads an doc inside a iframe dynamically
URL = thePage;
IFrameObj = new Object();
IFrameObj.document = new Object();
IFrameObj.document.location = new Object();
IFrameObj.document.location.iframe = document.getElementById('cpaneif');
IFrameObj.document.location.replace = function(location) {
this.iframe.src = location;
}

if (navigator.userAgent.indexOf(‘Gecko’) !=-1 && !IFrameObj.contentDocument) {
// allow a fraction of a second to recognize the new IFrame
//setTimeout(‘loadIFrame(“‘+thePage+'”)’,10);
//return false;
}

if (IFrameObj.contentDocument) {
// For NS6
IFrameDoc = IFrameObj.contentDocument;
} else if (IFrameObj.contentWindow) {
// For IE5.5 and IE6
IFrameDoc = IFrameObj.contentWindow.document;
} else if (IFrameObj.document) {
// For IE5
IFrameDoc = IFrameObj.document;
} else {
return true;
}

IFrameDoc.location.replace(URL);
/* NB:-
//if you want to create a new iframe dynamically visit
http://developer.apple.com/internet/webcontent/iframe.html
*/
}

Replace your default List Images/bullets with Images

By Assigning images for bullets in css you can do it simply.

list-style-image: url(‘yourimage.gif’);

Ever wanted a scroll bar for your table ?

Have you ever wanted scrollbars for your table? it is simple folk.
yourdiv style=”overflow:scroll;height:80px;width:100%;overflow:auto”
yourtable here
yourdiv

Change the usual hr tag with images


div.hr {
height: 15px;
background: #fff url(hr1.gif) no-repeat scroll center;
}
div.hr hr {
display: none;
}

yourdiv class="hr" your hr here /yourdiv

The ‘alt’ property does not work with mozilla/firefox

The correct property to use for tooltips is title. The ‘alt’ property has a very important purpose, which is to provide replacement text for images in browsers that cannot or do not (by user’s choice) display images, and if graphical browsers display them as tooltips people will be discouraged from using them for their correct purpose.

for more info https://bugzilla.mozilla.org/show_bug.cgi?id=25537

Feedback Form