Antonio Angelo

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromAntonio Angelo
ToMe
Subjectevent handlers has different behaviour under Firefox
Date3 September 2004 09:50
Hello!

First of all, I found your site quite good (a real mine full of useful
infos and tips!).

I write you for some help (if you can) about a problem with Javascript
and Mozilla Firefox browser (0.9.2).
The problem arise wit ASP pages, but I isolate te problem to a simpler
HTML frameset (that reproduces the same problem).

In a frameset, I've a navigation bar and an info frame.
The info frame is refreshed by a link in navigation bar.

Under some events (such as mouseover), all elements of info frame must
display title attribute value in status bar.
To easy the maintenance of my pages, I set both title attribute and
event handlers by calling a Javascript function (at the end of my page).

All works OK except when I open my frameset with Mozilla Firefox and
refresh info frame with the link located in navigation frame.
If I load only the info frame, all is OK.

With IE5 and HTML-Kit (my preferred programming tool), there is no such 
problem.

This is a fragment of the Javascript code (cycled for all elements):
...
myForm.elements[n].title = elTitle;
myForm.elements[n].onfocus = function(){window.status=this.title;}
...

Here are the pages:
[links to the pages]

Please apologize me for this mail, but I cannot solve the problem.
MANY TANKS.

Antonio Angelo
FromMe
ToAntonio Angelo
SubjectRe: event handlers has different behaviour under Firefox
Date3 September 2004 18:41
Antonio,

interesting. yes, I can see what the problem is.

[Ed. Try it here using Mozilla, Netscape 6+ or Firefox:
Click this link
This line tries to change the text in the status bar]

the link that makes the refresh is still focused, so the window status
stays the address of the link

to stop this, you need to remove the focus from the link after you click on
it. change this:
<a href=' _test_info.html' target='test'>reload other frame</a>
to this
<a href=' _test_info.html' target='test'
 onclick='if(this.blur){this.blur();}'>reload other frame</a>
 
as well as using blur() you must also stop the 'alert' messages

also, if you move your mouse over the link to refresh, you will find the
problem stops
this is because the alerts stop the browser from detecting when the mouse
moves away from the link

The problem should now stop.

Hope this helps

Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromAntonio Angelo
ToMe
SubjectRe: event handlers has different behaviour under Firefox
Date6 September 2004 10:43
Mark

Thank you for the suggestion!
You're right.

~~~~~~~~~~~~~~~~~~~~~~
Antonio Angelo
FromAntonio Angelo
ToMe
Subjectproblem with javascript text scroll
Date13 October 2006 13:52
Hello!
Your site is increasingly interesting!

I need to show some text inside a 'box', with continuos automatic
vertical scroll of the text.
For 'box' I mean any HTML element that can appear in a box-like
fashion (textarea, div etc.)

1st trial
A simple javascript function updates the value of a textarea.
It works ok with Firefox, but I cannot hide scrollbars for IE.
The only trick I found consist in setting scrollbar colors like the
textarea background, but this does not solve the problem.
Here is the source code (CSS styles are not shown here):

<script type = "text/javascript">
<!--
////////////////////////////////////////////////////////////
// Custom message:
var message = [
"message1"
,"message2"
,"message3"
];

////////////////////////////////////////////////////////////
// Custom parameters:
var rowsToDisplay = 6;
var duration_ms = 1000;

////////////////////////////////////////////////////////////
// Scroller function
function fill_text() {
 msg = message.slice(0,rowsToDisplay);
 document.form_name.txtMessage.value = msg.join(' ');
 temp = message;
 message = message.slice(1);
 message.push(temp[0]);
 setTimeout('fill_text(message)', duration_ms);
}
// -->
</script>

<style type="text/css">
<!--
.scroller {
 width:140px;
 height:140px;
}
-->
</style>
<!-- <body> -->

<form id="form_id" name="form_name">
<textarea class="scroller" name="txtMessage"></textarea>
</form>

</body>
<script type = "text/javascript">
fill_text();
</script></html>

2nd idea
The 'accessed' page contains an iframe that links to another page.
The linked page is periodically updated by a Javascript function with
document.write(...).
I made some experiments but I cannot make all work.

Can you suggest me a better way to do that?

Many thanks.

Antonio Angelo
FromMe
ToAntonio Angelo
SubjectRe: problem with javascript text scroll
Date13 October 2006 19:05
Antonio,

> It works ok with Firefox, but I cannot hide scrollbars for IE.

Please also test Opera, as I request on my contact page:
http://www.howtocreate.co.uk/sendEmail.php#testbrowsers

In any case, apply overflow:hidden to the textarea to hide the scrollbar in
all current browsers.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.