473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Re: Safari and className oddity?

SAM
Geoff Cox a écrit :

Didn't try but following what you say : move the mouse,
it seems that Safari keeps focus on the clicked image
and avoid the changing

see bellow
<div id="test1" class="visibleDiv2">
<h3>Test 1:</h3>
<IMG alt="image" id="a10" src="../assets/images/play1.gif"
onclick="musicSelect(this);">
</div>
<div id="test11" class="hiddenDiv2">
<IMG alt="image" id="a11" src="../assets/images/mypitch1.gif"
onclick="checkThisFirst();">
<IMG alt="image" id="a12" src="../assets/images/notmypitch1.gif"
onclick="checkThisSecond();">
</div>

<div id="test2" class="hiddenDiv2">
<h3><em>Test 2:</em></h3>
<IMG alt="image" id="a20" src="../assets/images/play1.gif"
onclick="musicSelect(this);">
</div>
<div id="test21" class="hiddenDiv2">
<IMG alt="image" id="a21" src="../assets/images/mypitch1.gif"
onclick="checkThisFirst();">
<IMG alt="image" id="a22" src="../assets/images/notmypitch1.gif"
onclick="checkThisSecond();">
</div>

etc

onclick() in the first block calls musicSelect(this)

function musicSelect(what) {

if (egfinished2 != 'yes') {
alert('Click again once the last sound above has finished');
return;
}

t = what.id.substring(1,2);
what.onclick = '';
what.src = played.src;
soundManager.createSound({
id:'mySound'+t,
url:'../assets/audio-new/Track' + (+t) + '.mp3',
onfinish:function(){document.getElementById('test' +t+1).className =
'visibleDiv2'} });
soundManager.play('mySound'+t);
count++;
// perhaps here :
what.blur();
}

when the sound is finished

document.getElementById('test'+t+1).className = 'visibleDiv2'

and it is now that the mouse has to be moved to get the .className =
'visibleDiv2' to work. I have also tried .style.display etc and no
different.
If the blur() up there doesn't work, try :

onfinish: function() {
document.getElementById('test'+t+1).focus();
// or probably better ... :
// location='#test'+t+1;
document.getElementById('test'+t+1).className = 'visibleDiv2';
}
});
--
sm
Jun 27 '08 #1
3 2288
On Sun, 15 Jun 2008 16:18:33 +0200, SAM
<st*********************@wanadoo.fr.invalidwrote :
>Geoff Cox a écrit :

Didn't try but following what you say : move the mouse,
it seems that Safari keeps focus on the clicked image
and avoid the changing

see bellow
><div id="test1" class="visibleDiv2">
<h3>Test 1:</h3>
<IMG alt="image" id="a10" src="../assets/images/play1.gif"
onclick="musicSelect(this);">
</div>
<div id="test11" class="hiddenDiv2">
<IMG alt="image" id="a11" src="../assets/images/mypitch1.gif"
onclick="checkThisFirst();">
<IMG alt="image" id="a12" src="../assets/images/notmypitch1.gif"
onclick="checkThisSecond();">
</div>

<div id="test2" class="hiddenDiv2">
<h3><em>Test 2:</em></h3>
<IMG alt="image" id="a20" src="../assets/images/play1.gif"
onclick="musicSelect(this);">
</div>
<div id="test21" class="hiddenDiv2">
<IMG alt="image" id="a21" src="../assets/images/mypitch1.gif"
onclick="checkThisFirst();">
<IMG alt="image" id="a22" src="../assets/images/notmypitch1.gif"
onclick="checkThisSecond();">
</div>

etc

onclick() in the first block calls musicSelect(this)

function musicSelect(what) {

if (egfinished2 != 'yes') {
alert('Click again once the last sound above has finished');
return;
}

t = what.id.substring(1,2);
what.onclick = '';
what.src = played.src;
soundManager.createSound({
id:'mySound'+t,
url:'../assets/audio-new/Track' + (+t) + '.mp3',
onfinish:function(){document.getElementById('test '+t+1).className =
'visibleDiv2'} });
soundManager.play('mySound'+t);
count++;

// perhaps here :
what.blur();
>}

when the sound is finished

document.getElementById('test'+t+1).className = 'visibleDiv2'

and it is now that the mouse has to be moved to get the .className =
'visibleDiv2' to work. I have also tried .style.display etc and no
different.

If the blur() up there doesn't work, try :

onfinish: function() {
document.getElementById('test'+t+1).focus();
// or probably better ... :
// location='#test'+t+1;
document.getElementById('test'+t+1).className = 'visibleDiv2';
}
});
I have tried all 3 and still the same - I have to move the mouse
cursor to get any action!?

Cheers,

Geoff
Jun 27 '08 #2
SAM
Geoff Cox a écrit :
>
I have tried all 3 and still the same - I have to move the mouse
cursor to get any action!?
As I will not install soundManager and muszicks
my test in Safari can't show me your problem,
the click does click and 2nd image appears.

put your page on a server.
--
sm
Jun 27 '08 #3
On Sun, 15 Jun 2008 19:40:19 +0200, SAM
<st*********************@wanadoo.fr.invalidwrote :
>Geoff Cox a écrit :
>>
I have tried all 3 and still the same - I have to move the mouse
cursor to get any action!?

As I will not install soundManager and muszicks
my test in Safari can't show me your problem,
the click does click and 2nd image appears.

put your page on a server.
will do and will email you with the link.

Cheers

Geoff
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Joshua Beall | last post by:
Hi All, I have been trying to dynamically call a static member function, as follows: $className = 'MyClass'; $methodName = 'MyMethod' $result = $className::$methodName(); However, I get a...
3
by: Ante Perkovic | last post by:
Hi, Sorry if this is OT :( I have some old CSS files that have all class names preceded with tagname, like "TD.verysmall" or "span.important". I'm exeprimenting with Dreamwiever and I noticed...
1
by: Peter King | last post by:
if you assign multiple classes in order to keep your classes generic e.g ..classA { position.absolute; left:5 top:5 height:200 width:800 } ..classB { background-color: red} ..classC {...
4
by: Ben R. | last post by:
Between ClassName and Inherits, which attribute is set to specify the class that a page uses? I would think that would be inherits. Further, the description for ClassName is: Specifies the class...
2
by: bmgz | last post by:
I have written a script that highlights a table row when the appropriate checkbox is checked. Using element.style is a bit messy and doesn't really fulfil my needs.. I want to just be able to...
5
by: jmdocherty | last post by:
All, I've been trying to set up a CSS layout and all seems well in Firefox but in Safari it just seems to be plain weird! I hope someone can help tell me whether this is a problem with my code...
3
by: dd | last post by:
Hi, I have some code that hides all Flash objects on a page. It's working fine on IE and Gecko but doesn't work on Safari. There are no errors (shown in the console) when it runs on Safari, and...
9
hsriat
by: hsriat | last post by:
I have to toggle the name of a hyperlink from Edit to Save and vice-versa on click event of the same hyperlink. This is the HTML part, <input class="text" id="ix1" type=text></input> <a...
4
by: Geoff Cox | last post by:
Hello, I am using Safari (v3.1.1) on a PC and click on an image to play a sound. Once the sound is finished 2 images appear and the user has to select one of them. This works perfectly well...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.