Here is my problem, I was using Prototype 1.6.0 and Scriptaculous
1.8.1 and decided it was time to upgrade to Prototype 1.6.1 and
Scriptaculous 1.8.2. I have a snipet of code that used to work before
upgrading I couldn't figure out why. Below is a my code, the first
child function works but the last child seems to not work at all. I
didn't see any changes in the API for different ways of doing Each
Loops or CSS Selectors. Anyone got an idea?
var firstMenuItem = $$('#preview-accordion-menu.accordion
div.accordion-toggle:first-child');
var lastMenuItem = $$('#preview-accordion-menu.accordion
div.accordion-toggle:nth-last-of-type(1)');
firstMenuItem.each(function (element, index) {
Event.observe(element, 'mouseover', function () {
$('pg-nav-hover').removeClassName('panel-accordion');
$('pg-nav-hover').addClassName('accordion-top-hover');
});
Event.observe(element, 'mouseout', function () {
$('pg-nav-hover').removeClassName('accordion-top-hover');
$('pg-nav-hover').addClassName('panel-accordion');
});
});
lastMenuItem.each(function (element, index) {
element.addClassName('last');
Event.observe(element, 'mouseover', function () {
$('pg-nav-hover').removeClassName('panel-accordion');
$('pg-nav-hover').addClassName('accordion-bottom-hover');
});
Event.observe(element, 'mouseout', function () {
$('pg-nav-hover').removeClassName('accordion-bottom-hover');
$('pg-nav-hover').addClassName('panel-accordion');
});
});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---