+ Reply to Thread
Results 1 to 10 of 10

Thread: IE compatibility

  1. #1
    olliepop's Avatar
    olliepop is offline x10 Sophmore olliepop is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    137

    IE compatibility

    Hi x10 programmers

    I'm working on an entry for a web competition, it has to be on something we're learning this year, so i chose Life in Nazi Germany. I am NOT A NAZI.

    The URL is http://tribalcorp.net

    The menu works perfectly on all browsers BUT ie.

    The rules state the website must function equally for all browsers.

    Who knows why this script isn't compatible with Internet Explorer?

    Code:
    <script type="text/javascript"> 
    if (!document.layers) {
    document.write('<div id="divStayTopLeft" style="position:absolute">');
    }
    </script>
    
    <div id="divStayTopLeft">
    
    <!--EDIT BELOW CODE TO YOUR OWN MENU-->
    <table border="0" width="130" cellspacing="0" cellpadding="0">
      <tr>
        <!-- <td width="100%" bgcolor="#FFFFCC">
          <p align="center"><b><font size="4">Menu</font></b></td> -->
    
      </tr>
      <tr>
        <td width="100%">
          <p align="left"><div class="navbar" id="navbar" name="navbar">&nbsp;</div>
    	  </td>
      </tr>
    </table>
    <!--END OF EDIT-->
    
    </div>
    
    
    <script type="text/javascript">
    
    /*
    Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
    Script featured on/available at http://www.dynamicdrive.com/
    This notice must stay intact for use
    */
    
    var verticalpos="frombottom";
    
    if (!document.layers) {
    document.write('</div>');
    }
    
    function JSFX_FloatTopDiv()
    {
    	var startX = 3,
    	startY = 600;
    	var ns = (navigator.appName.indexOf("Netscape") != -1);
    	var d = document;
    	function ml(id)
    	{
    		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
    		if(d.layers)el.style=el;
    		el.sP=function(x,y){this.style.left=x;this.style.top=y;};
    		el.x = startX;
    		if (verticalpos=="fromtop") {
    		el.y = startY;
    		}else{
    		el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
    		el.y -= startY;
    		}
    		return el;
    	}
    	window.stayTopLeft=function()
    	{
    		if (verticalpos=="fromtop"){
    		var pY = ns ? pageYOffset : document.body.scrollTop;
    		ftlObj.y += (pY + startY - ftlObj.y)/8;
    		}
    		else{
    		var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
    		ftlObj.y += (pY - startY - ftlObj.y)/8;
    		}
    		ftlObj.sP(ftlObj.x, ftlObj.y);
    		setTimeout("stayTopLeft()", 10);
    	}
    	ftlObj = ml("divStayTopLeft");
    	stayTopLeft();
    }
    JSFX_FloatTopDiv();
    </script>
    Thanks for your time
    Last edited by olliepop; 08-28-2009 at 04:57 PM. Reason: changed code

  2. #2
    lhyman's Avatar
    lhyman is offline x10 Sophmore lhyman is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    198

    Re: IE compatibility

    Don't know, I don't even have time right now to look at it, but I want to give you some very helpful advice.... (has helped me anyways)

    If you want a good meun system the will work with all browsers, take a look here:

    http://www.dynamicdrive.com/

    and also:

    test your site in IE first because it is the most pickey, if it works fine in IE with no errors, then try it in firefox and then Opera

    Sorry if I wasn't much help, but I have to run....
    Last edited by lhyman; 08-28-2009 at 05:00 PM.
    My Name is Larry Hyman from Montreal. I fix computers on site, see my web site for more details:

    http://hyman.sytes.net

  3. #3
    sourfacedcyclop's Avatar
    sourfacedcyclop is offline x10 Sophmore sourfacedcyclop is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    221

    Re: IE compatibility

    I'm not really in the mood to debug it for you, but just looking at the source code, I see some markup errors, try running it through an XHTML validater and fixing those errors.
    "Sanity is nothing but our interpretation of reality"

    http://tswebvisions.com - Portfolio

  4. #4
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: IE compatibility

    Quote Originally Posted by lhyman View Post
    Don't know, I don't even have time right now to look at it, but I want to give you some very helpful advice.... (has helped me anyways)

    If you want a good meun system the will work with all browsers, take a look here:

    http://www.dynamicdrive.com/
    I believe that olliepop is currently using a dynamic drive menu.

    Anyways, I personally use Simple Javascript Drop Down Menu on my website and I have no compatibility errors under IE, FF, Opera or other.

    And as sourfacedcyclop said, you better check your code for (X)HTML compliance.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  5. #5
    lhyman's Avatar
    lhyman is offline x10 Sophmore lhyman is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    198

    Re: IE compatibility

    well, I just copied his code to a new page and put it inbetween the body tage, all I got was thank you for your time

    I went to the author's site..... maybe he's not following the instructions... the site is here, maybe, he can review it again...

    http://www.javascript-fx.com/navigation/index.html

    I got a dhtm menu from dynamic drive once... everything worked... but you really got to follow instructions... have a look here:

    http://www.gennysuniforms.com/newhome.htm
    Last edited by lhyman; 08-28-2009 at 07:41 PM.
    My Name is Larry Hyman from Montreal. I fix computers on site, see my web site for more details:

    http://hyman.sytes.net

  6. #6
    saif7463 is offline x10Hosting Member saif7463 is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    30

    Re: IE compatibility

    Hi,

    It's actually your CSS that is failing in IE, not your invalid HTML (which you should still fix!)

    Apparently, IE does not like min-height or min-width. In order to use it correctly, one must make use of a hack. The easiest and quickest to implement would be: http://www.dustindiaz.com/min-height-fast-hack/.

    In your case, that would give you:

    Code:
    .navbar{
      background-image:url(images/nazimenu.png);
      max-height:500px;
      /* min-height hack */
      min-height:500px;
      height:auto !important;
      height:500px;
      
      max-width:300px;
      /* min-width hack */
      min-width:300px;
      width:auto !important;
      width:300px;
    }
    Of course, in your case, there really isn't a reason to use max/min... so why not just use width and height, as in the following code?

    Code:
    .navbar{
      background-image:url(images/nazimenu.png);
      height:500px;
      width:300px;
    }
    No hacks needed, and best of all, it works in all browsers

  7. #7
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: IE compatibility

    Quote Originally Posted by olliepop View Post
    Code:
    <script type="text/javascript"> 
    if (!document.layers) {
    document.write('<div id="divStayTopLeft" style="position:absolute">');
    }
    </script>
    NN4 is dead, buried and rotted to dirt.

    Quote Originally Posted by olliepop View Post
    Code:
    <table border="0" width="130" cellspacing="0" cellpadding="0">
    That's not tabular data. Don't abuse tables ([2]).

    These days, you don't need JS for menus. You can use fixed positioning (not supported in IE6, but you can emulate it) to keep the menu always in view. To display/hide submenus, use the ':hover' pseudo class (examine pure CSS menu techiques for details). The code to display/hide a submenu can be as simple as:
    Code:
    .submenu {
        display: none;
    }
    .menu li:hover>.submenu, .show {
        display: block;
    }
    Position the submenus absolutely:
    Code:
    .menu li {
      position: relative;
      width: 15em;
    }
    .submenu {
      position: absolute;
      /* Side menu. Top menu would set 'left' to 0 and 'top' to 1em */
      top: 0;
      left: 15em;
    }
    If you need to support hovering in IE6, just include mouseOver/mouseOut event listeners that add/remove a "show" class. The only times CSS menus are insufficient are when you want menu animation or delays.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  8. #8
    vekou's Avatar
    vekou is offline x10 Sophmore vekou is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    162

    Re: IE compatibility

    Quote Originally Posted by misson View Post
    NN4 is dead, buried and rotted to dirt.
    I very much agree. Netscape is obsolete now. I think you've copied your code from a website with a content of almost a decade ago.

    You said that the page must be treated equally by all browsers. It's possible, but highly unlikely. They should've given a set of browsers that the content must work. If they're expecting that your page must work on IE3 and Netscape4, you're in a deep s**t. At least make your code working perfectly on browsers made 5 years ago.
    We hate people who solicit reputation using their signatures. Click if you agree.

  9. #9
    olliepop's Avatar
    olliepop is offline x10 Sophmore olliepop is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    137

    Re: IE compatibility

    Quote Originally Posted by saif7463 View Post
    Code:
    .navbar{
      background-image:url(images/nazimenu.png);
      height:500px;
      width:300px;
    }
    No hacks needed, and best of all, it works in all browsers
    Thank you SO MUCH!!! You saved my entry xD

    Thank you everyone else for your input, i will begin fixing the errors.

    Also, yes it is a dynamic drive menu and i did follow the instructions perfectly.
    The instructions were: copy and paste this code right before </body>.

    Rofl.

  10. #10
    saif7463 is offline x10Hosting Member saif7463 is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    30

    Re: IE compatibility

    You're welcome!

    By the way, as mission said, it's bad to use a table without tabular data. In fact, your code will essentially be the same if you remove all of the table stuff (everything between the two comment tags) and just replace it with your div.

+ Reply to Thread

Similar Threads

  1. Internet Explorer compatibility
    By Teensweb in forum Programming Help
    Replies: 4
    Last Post: 08-25-2008, 01:31 AM
  2. PS3 Or XBOX 360
    By beandab in forum Gamer's Lounge
    Replies: 117
    Last Post: 08-13-2008, 09:03 AM
  3. Microsoft Internet Explorer 8 Beta 1 is out!
    By ashwinsinha in forum Computers & Technology
    Replies: 11
    Last Post: 03-07-2008, 04:49 AM
  4. Interesting article on Vista vs. XP 7 months later
    By roctronic in forum Computers & Technology
    Replies: 2
    Last Post: 01-16-2008, 01:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers