...

View Full Version : Javascript disappears in IE7...



`mishimasan`
08-16-2008, 04:34 PM
Someone please help. My code works fine in Firefox/Safari but it just does not appear in IE7.

www.easidesigns.co.uk/test

Could someone please tell me why?


<script type="text/javascript">
var revert = new Array();
var inames = new Array('branding','print','stationery','web','photography','about','news','contact');

if (document.images) { // Preload
var flipped = new Array();
for(i=0; i< inames.length; i++) {
flipped[i] = new Image();
flipped[i].src= "images/"+inames[i]+"2.png";
}
}

function over(num) {
if(document.images) {
revert[num]=document.images[inames[num]].src;
document.images[inames[num]].src= flipped[num].src;
}
}
function out(num) {
if(document.images) document.images[inames[num]].src= revert[num];
}
</script>


<div id="container">

<div id="menu1">

<ol id="line1">

<li class="brand">
<a href="branding.html" <img src="images/branding.png" name="branding" onMouseOver="over(0)" onMouseOut="out(0)"></a>
</li>
<li class="print">
<a href="print.html" <img src="images/print.png" name="print" onMouseOver="over(1)" onMouseOut="out(1)"></a>
</li>
<li class="stationery">
<a href="stationery.html" <img src="images/stationery.png" name="stationery" onMouseOver="over(2)" onMouseOut="out(2)"></a>
</li>

</ol>

</div>

<div id="menu2">

<ol id="line2">

<li class="web">
<a href="web.html" <img src="images/web.png" name="web" onMouseOver="over(3)" onMouseOut="out(3)"></a>
</li>
<li class="photography">
<a href="photography.html" <img src="images/photography.png" name="photography" onMouseOver="over(4)" onMouseOut="out(4)"></a>
</li>

</ol>

</div>

<div id="menu3">

<ol id="line3">

<li class="about">
<a href="about.html" <img src="images/about.png" name="about" onMouseOver="over(5)" onMouseOut="out(5)"></a>
</li>
<li class="news">
<a href="news.html" <img src="images/news.png" name="news" onMouseOver="over(6)" onMouseOut="out(6)"></a>
</li>
<li class="contact">
<a href="contact.html" <img src="images/contact.png" name="contact" onMouseOver="over(7)" onMouseOut="out(7)"></a>
</li>

</ol>

</div>

</div>

Bill Posters
08-16-2008, 04:38 PM
Always, always check your code validity before asking for help debugging. (http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you)



p.s.

This site is optimised for Firefox
Optimised in what way? Let optimisations be silent (&#224; la 'progressive enhancements), so that those who have more optimal UAs get the fuller experience, whilst those without should ideally be left blissfully unaware and left to get on with the business of using your site.

(Web designers/developers should be past making such declarations these days. It's not particularly hard to get effectively identical sites in FF, IE6+, Op, Saf, …)

`mishimasan`
08-16-2008, 04:40 PM
Thanks dude. Will validate now.

`mishimasan`
08-16-2008, 09:55 PM
Always, always check your code validity before asking for help debugging. (http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you)



p.s.

Optimised in what way? Let optimisations be silent ( la 'progressive enhancements), so that those who have more optimal UAs get the fuller experience, whilst those without should ideally be left blissfully unaware and left to get on with the business of using your site.

(Web designers/developers should be past making such declarations these days. It's not particularly hard to get effectively identical sites in FF, IE6+, Op, Saf, )

I think you're right, I was actually just being told by someone else to remove it. I'm a newbie, left right and centre and it's showing big style which is great because it gives me a chance to get with the times before I actually go live.

`mishimasan`
08-17-2008, 09:46 AM
The W3C validation tool, fixed the Javascript menu.


<div id="newbiness" style="display:none;">

Thanks for the help.

</div>

However, the saga of easidesigns continues over here (http://www.codingforums.com/showthread.php?t=146833) if you're interested...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum