Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Nov 2007
    Posts
    38
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Javascript disappears in IE7...

    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?

    Code:
    <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>

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Always, always check your code validity before asking for help debugging.



    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, …)
    Last edited by Bill Posters; 08-16-2008 at 03:46 PM.

  • Users who have thanked Bill Posters for this post:

    `mishimasan` (08-16-2008)

  • #3
    New Coder
    Join Date
    Nov 2007
    Posts
    38
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thanks dude. Will validate now.

  • #4
    New Coder
    Join Date
    Nov 2007
    Posts
    38
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Bill Posters View Post
    Always, always check your code validity before asking for help debugging.



    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.

  • #5
    New Coder
    Join Date
    Nov 2007
    Posts
    38
    Thanks
    9
    Thanked 0 Times in 0 Posts
    The W3C validation tool, fixed the Javascript menu.

    Code:
    <div id="newbiness" style="display:none;">
    
         Thanks for the help.
    
    </div>
    However, the saga of easidesigns continues over here if you're interested...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •