As part of my site relaunch, I needed to rewrite a couple of things using jQuery instead of Mootools. One of these things is the Man Page footer at the bottom of the site. Rewriting it using jQuery actually ended up being fairly easy.
I was working on a bit of script today, and happened upon an interesting happenstance. I was trying to change the text of an element dynamically, and this text needed to include a non-breaking space. My original code seemed to render the entity as text, so this:
elem.setText( ' ' );
literally printed the text " " instead of the proper entity.
If you've ever done any scripting using the Mootools library that ships with Joomla, perhaps you've come across a situation where you needed to prevent a link from following it's assigned location. Mootools has a function for Events called 'stop', but it is not extended to Events in 1.11. So how do you stop the link from following it's href?
There's a really cool site at konamicodesites.com that lists a whole bunch of sites that have easter eggs if you type a certain pattern while visiting. That pattern is the famous Konami Code. It lists some pretty large sites, like Facebook and Digg.
I went ahead and wrote a quick little bit of JavaScript that implements this functionality. It's loaded into the site you're looking at right now!
Some of you may have noticed the box at the bottom of the screen that keeps track of the page's vertical position. I wrote this in Mootools to sort of mimic some command line Linux tools like "less", "more", and "man".
Valid XHTML Strict doesn't support the 'target' tag for links, but some webmasters (me included) don't like the idea of having external links draw our visitors away, possibly to never return. That's why the 'target' tag is great - external links can open new windows (or tabs, browser willing), right?
You may have noticed that some of the links on this site are followed by the domain in brackets. This is something I really liked about links posted on Slashdot, so I figured I'd go ahead and do my own little rendition of this functionality.
While working on this template, I was having an issue with both IE and Opera not rerendering things properly if the browser window was only resized vertically. What's odd is that certain JavaScript hover events would force some elements to be redrawn, thus "fixing" the problem.
Below is the short script I wrote to force IE and Opera to redraw a specific element, the wrapper of the site. It requires Mootools 1.11.
I've been going through my $HOME looking for things to post, and came across this little snippet:
I wrote a little jQuery script for accordion menus. Hope you like it: