[thelist] javascript help

Caleb Mazalevskis webmaster at cmaza.net
Tue Dec 21 06:25:33 CST 2004


Peter Brunone (EasyListBox.com) wrote:

> 	When I run the page in Firefox (actually Firebird), I get "nav
> is not defined" on line 46 of /test/_inc_menunav.js .
> 
> -----Original Message-----
> From: thelist-bounces at lists.evolt.org On Behalf Of Rita Crisafi
> 
> http://www.andreasbrickoven.com/test/menu.html
> 
> I had all kinds of crazy specs from this client and i know that the
> images 
> are large (didn't design it). The client wanted menu stuff to scroll on
> the 
> page, so I found a simple javascript that scrolls content in an iframe
> for 
> this page.
> 
> 
> 
>><script type="text/javascript">
>>/**********************************************************************
> 
> ***
> 
>>  This code is from Dynamic Web Coding at http://www.dyn-web.com/
>>  See Terms of Use at http://www.dyn-web.com/bus/terms.html
>>  regarding conditions under which you may use this code.
>>  This notice must be retained in the code as is! 
>>***********************************************************************
>>**/
>>
>>var timer_id;
>>function scroll_iframe(frm,inc,dir) {
>>  if (timer_id) clearTimeout(timer_id);
>>  if (window.frames[frm]) {
>>    if (dir == "v") window.frames[frm].scrollBy(0, inc);
>>    else window.frames[frm].scrollBy(inc, 0);
>>    timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" 
>>+
>>dir + "')", 20);
>>  }
>>}
>>
>>function stopScroll() { if (timer_id) clearTimeout(timer_id); } 
>></script>
> 
> 
> 
> 
> What i didn't realize at the time, is that it only works in IE and not 
> firefox or netscape. Does anyone know of why and if there is any kind of
> 
> modification i can make so that it will work in other browsers? 


Hi.

I know what I'm about to suggest isn't exactly what your looking for... 
but have you ever considered using a flash object?

Advantages:
- Less messing around with JavaScript and such, easier to deal with.
- Makes it harder for visitors to grab images from your client (if like 
most clients I know, they're pedantic about such things).
- As long as flash player is installed, it should run exactly the same 
on every browser.
- It all loads at once and no delay is formed between fades.

Disadvantages:
- Harder to edit if you need to add another image to your collection.
- Takes longer to load on slower connections.
- Won't load at all in IE if active objects have been disabled in the 
users security preferences.

The pros and cons are pretty much head at head, so it really boils down 
to a matter of personal opinion... but I thought I'd just point out the 
option. :)

-Caleb.



More information about the thelist mailing list