OK I solved the problem.
It wasn't with the JS at all, but the fact that IE 6 displayed the select box underneath another image. Duh.
I simply adjusted the CSS of the select box in IE 6 and everything is fine.
Thanks feherke for pointing out that it should work in IE6, that saved me a lot of time.
I changed my mind. Here's the relevant code, maybe I did something wrong:
markup:
<a id="images_button" class="SetMeter" href="#gs_imgs"></a>
and then the select in the form:
<form id="img_list">
<select id="gasom_images">
<option value="">Change Images</option>
<option value="">No...
Thanks feherke, I thought that IE 6 supported the style property and getElementById, so now I can look for my error elsewhere.
I'd post the JS code but there's way too much of it!
I use this code to dynamically change the visibility of a div:
document.getElementById('div_id').style.display="block";
document.all.div_id.style.display = "block"; // for IE 6
The first code statement works great in all browsers (including IE7+) but not in IE6, so I added the second...
Thanks Dan.
I finally managed to solve the problem by calling two event handlers from window.onload.
window.onload = setupPage;
function setupPage()
{
addEvent (document.getElementById('activatebutton'), 'mousedown',changeImage);
addEvent (document.getElementById('activatebutton')...
Thanks for that.
I probably didn't make myself as clear as I should have.
What I want to do is eliminate all javascript calls from the HTML.
I want to separate out the HTML from the javascript.
So my code ideally would look like this:
<code> <li><a id="activatebutton" class="button1" href="#"...
I have the following line of code in my HTML, which fires off Javascriot functions. I want to separate the JS from the HTML, but I'm not sure how to do it. Here's the code:
<code><li><a id="activatebutton" class="button1" href="javascript:activateIt();" onmousedown="changeimage(); return...
Thanks guys, that did the trick. Can't believe I didn't think of that myself, it was too simple. As usual with newbies to anything, I tried to make it too complicated.
I hate pop-ups too. This is for a little stand-alone app that a customer buys and puts on his desktop. It opens in an html...
Is this a pipe dream or a possibility with Javascript?
I have an html page with a button. The user pushes the button and the script opens a new window, loads a swf file, and auto plays it.
This seems like too much for Javascript, but I am new to JS and wonder if any gurus out there knew if...
Thanks tsuji, for all your help.
I will try all that. Also, it seems that Javascript works slightly different in IE than in other browsers (no mystery there!)
If I simply say
<code>setTimeout ("",5000); </code>
and combine the openNewWindow() func into the changeImage () func, the window opens but there is no 5 second delay.
Obviously, I am missing something!
Thanks for that tsuji -
It's a little better because Firebug is working properly now and I can follow along with what's happening in the code.
What's happening is that setTimeoout fires, waits 5 secs, but activateNewWindow(). doesn't get called.
That seems totally bizarre.
BTW, why the...
darn, I copied the code wrong.
It should be this:
<code> <img id="someimage" src="Image1.gif" alt = "" /></code>
.....
<code><li><a class="button1" href="javascript:void()" onclick="javascript:changeImage()"></a></li></code>
<code>function changeImage()
{
/* change image to the...
I have the following image and button code:
<code> <img id="someimage" src="Image1.gif" alt = "" /></code>
.....
<code><li><a class="button1" href="javascript:void()" onclick="javascript:activateNewWindow()"></a></li></code>
This func will replace the Image1.gif image on my page with an...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.