Pages (1): «1»
avatar

Prototype Event.fire() is not firing native events

December 15th, 2009 in JS / CSS / xHTML 0 comments
Using Prototype to observe for submit a form that has no submit button and sending it with javascript using .submit() the event is not caught. Checking the Prototype API I found out there is Event.fire() that fires events on a given element. The problem is that .fire() is not firing native events, only custom ones.

Using the code from Protolicious on github solves missing functionality Prototype has. Saving this and including it after Prototype fixes the problem of firing native events.

simulate.js to view the code read the full post ...read more
avatar

Sidebar with script.aculo.us effects

November 24th, 2009 in JS / CSS / xHTML 0 comments
I found nothing that suites my needs so I made this sidebar using Prototype and script.aculo.us. I use this sidebar in the CMS I made using CakePHP. The sidebar can have only one sub level, which on click will be blinding up and down, leaving the active element always open, in case it has a sub level. Also the top level elements will slide sideways on mouse hovering, this giving a nice visual effect.

Save the following code as sidebar.js: to view the code read the full post
Include the script: to view the code read the full post
The structure looks like this: to view the code read the full post
Every top level link must have the class name "nav-top-item" and if has no sub level it also must have the class name "no-submenu". To show the selected link and keep the sub ...read more
avatar

Remove outline from links

November 25th, 2008 in JS / CSS / xHTML 1 comment
I got really bored to see outlined links when they get clicked, so I decided to remove the outline. It's just a simple CSS rule.

to view the code read the full post
However I didn't manage to remove the outlines from buttons. Any ideas how? ...read more