![]() |
Help w/ Event.observe / Scriptaculous
I have two questions for you guys...
1) how can I effeciently use Event.observe so that fadeOut() gets triggered every time a link is clicked? 2) every link features a different url... I am not sure how I can make fadeOut() point to the right url when a link is clicked... any suggestion? THANK YOU TONS!!! ^_^ Code:
<div id="countries_wrapper"> |
fyi, there are some really nice effects available for scriptaculous... you don't need to write your own. i'd suggest looking up Effect.Phase... it even supports toggling which means you can use it for fading in and out with every load\unload very easily. anyway... just have onclick or onmousedown inside your <a> call your function and have it fwd the url as a variable.
Code:
<a class="country" onclick="fadeout('put your url here');">english</a>Code:
<script type="text/javascript" charset="utf-8"> |
Your HTML is a bit of a mess, so I might be missing something but the following should work:
Code:
document.observe('dom:loaded', function() { //need to do it once everything's loadedAlternatively, you could use event-delegation and attach just one observer to the container: Code:
document.observe('dom:loaded', function() { |
| All times are GMT +1. The time now is 11:05 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.