Saturday, October 14, 2006

PNG Tranperancy Fix using Javascript

MSIE has a problem dealing with tranperance PNG images and someone decided to make a Javascript fix for it. How brilliant however sadly, I don't understand single thing in the JS codes. It's too high tech.

Download pngfix.js and insert it in the <head>:
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->


Posted at 08:21 am by Seige

Make a comment  

Saturday, September 30, 2006

PlotKit - Javascript Graphing

I just found a very interesting Javascript Library (kit) for doing graphs. I thought if it didn't exist I'd design it myself. Anyway, this one is pretty cool. It can do graphs and also has SVG support. How great is that? Check it out at: http://www.liquidx.net/plotkit/

Posted at 07:22 am by Seige

Make a comment  

Wednesday, June 07, 2006

addEvent() : Adding functions in Events to specific elements

Adapted from Dustin Diaz. Apparently this function is more than just useful and handy, it works on almost everything. It's also been said to do what addLoadEvent() is supposed to do. This means byebye addLoadEvent().

To execute it, here's the general formula:
addEvent( object, event type, function )
For example:
addEvent(window, 'load', function1);
addEvent(window, 'unload', function2);
addEvent(document.getElementById("ID"), 'mouseover', function3);
addEvent(document.getElementsByTagName("tn"), 'mouseout', function4);
addEvent(document.body, 'click', function5);
Here's how this function can replace addLoadEvent():
addEvent(window, 'load', function1);
addEvent(window, 'load', function2);
addEvent(window, 'load', function3);
What I have yet to understand:
- "object" and "event type" might mean something else so I could be wrong with what I have here.
- there should be more than just "window" and "getElementById" for objects.
- there should be more than just "mouseover" and "unload" for event types.
- Dustin Diaz has some pretty good stuff on his site, but he doesn't explane what each variable should be which I kinda got confused with.

This function seems pretty Rock Solid just like what it's name says. I think I'll be adding this to my Basic Tooling Functions.

Posted at 07:52 am by Seige

Make a comment  

Tuesday, June 06, 2006

addLoadEvent() : Adding functions to window.onload

Adapted from Simon Willison.

I've always had problem assigning window.onload events when there was a previous function being set to it. Adding window.onload deletes the previous function. This function allows adding functions to another function.

To use it is pretty straight forward:
addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
addLoadEvent(function() {
/* more code to run on page load */
});
This function can be replaced by using addEvent(), example:
addEvent(window, 'load', function1);
addEvent(window, 'load', function2);
addEvent(window, 'load', function3);

Posted at 11:15 am by Seige

Make a comment  

Monday, June 05, 2006

Blogdrive Blog Title, Permalink and PID (Post ID) Extractor

This script extracts the entry title, permalink and pid into a javascript variable. This allows some useful functions such as the minimeditor. It is necessary to go through this method because Blogdrive includes HTML tags into it's [blog title] and [permalink].

[date] and [time] are used to set unique IDs to avoid collisions. This script would work on all Blogdrive pages including search pages.

Three variables are returned, but it only last before the next entry appears.
permalink, pid, blogtitle
A bit of explanation on how this script works: The Blogdrive tag [blog title] returns (on all pages)
<div id="*****_kdub1">blog title</div>
where ***** is a random 5 digit value
and the Blogdrive tag [permalink] returns (in main index, archive and search pages)
<a href="http://javascript-library.blogdrive.com/archive/18.html" class="permalink">Permalink</a>
However, in permalink pages it only returns a single character space. In this case, the document.location is being used to determine its URL.

Using the function getBtw(), everything is pretty straight forward.

This codes are to be inserted into the main template between <blog> and </blog>:

Posted at 09:31 am by Seige

Make a comment  

<< July 2017 >>
Sun Mon Tue Wed Thu Fri Sat
 01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Google Homepage Modules
Modules Manager
Javascript Calculator
Tagalicious - Blogdrive
Blogdrive Templates
Blogdrive Favorites
XSL stylesheet for Google Modules

Other Javascript Framework / Libraries / Links
Google Homepage Javascript API (.js)
Prototype (.js)
jQuery (.js)
Encytemedia (.js)
MochiKit
dojo, the Javascript Toolkit
ESPX TinyXSL
Strange Zen of Javascript

Template Style
2 columns (right)
3 columns (right)
3 columns (center)
3 columns (left)
2 columns (left)

Contact Me
If you want to be updated on this weblog Enter your email here:
rss feed


BLOGDRIVE
TEMPLATES