473,513 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is UL reverse indenting in firefox, chrome, etc, but not in IE?

Elyse Summers
16 New Member
The site:

http://www.bradleyalanhart.com/index2.html

The context: When you start opening the flipmenu navigation in Firefox, the links open in a reverse indent cascading towrds the left (middle) of the page. Which, weirdly enough, is what I want. When you open it in Internet Explorer, it displays itself as a regular unordered list would.

ul/li style values have been set in both bahart2.css and flipmenu.js, both of which can be accessed from the page source.

The problem: I believe, lies in the fact that internet explorer is wrapping my longest line (under SCULPTURE > Forms revisited...) so it can display "properly" - and if I add the nowrap to it, instead of reversing like other browsers do it gives me a horizontal scrollbar.

So, how can I recreate this behavior in IE without fudging up how it looks in standard broswers? Is there a simple way to stop it from wrapping or is the issue something else entirely?

EDIT: Okay, adding the white-space:nowrap stops it from wrapping, but instead of reverse-indenting it it induces horizontal scrolling *headdesk* I really dislike button IE. Any help would be LOVED. Earlier post edited to reflect changes.
Dec 5 '10 #1
17 3132
Bryan Cheung
55 New Member
Hi Elyse,

First off; in flipmenu.js line 57: "margin_right" -I think you get it.

When looking in IE8 and opening the developer program(F12) I see that .flipMenu UL has a margin of 5px and not negative, same with the other stuff that needs to be negative.

And why the hell are you using js to write css, thats really nasty..

-B
Dec 5 '10 #2
drhowarddrfine
7,435 Recognized Expert Expert
I'm not on my dev computer so I can't look but IE uses margin for list endents while FF uses padding. (or is it the other way?)

btw, you are using the transitional doctype. New web pages should always use strict.
Dec 6 '10 #3
Elyse Summers
16 New Member
@ Brian Cheung: Thanks so much for pointing that out :) I'll start from there and hopefully work it out. I'm letting the javascript write the CSS for a few reasons, but mainly I didn't have time to write an entire script for the the navigation myself with the billable hours I was given for this project (also, javascipt's not my forte) so I used a shareware that best suited my needs, and that's how it came. Of course I could have gone in and seen how those commands interact and removed those lines from the js and set them in my own CSS file instead, but that would require extra time that isn't in the client's budget and I'm not in the habit of working for free, even if it means work I'm not 100% pleased with. It's at the top of my list of things to correct once we're live and he has budget to come back and make fixes, but it's not priority right now :(

@ Drhowarddrfine I knew there was something screwy in the way they handled lists, I'll have to look further into it if that is the issue. I *am* coding in transitional - HTML 4.01 strict doesn't support iFrames, which are crucial to the site's design. Normally I would use Strict and use the object tag that is meant to replace iFrames, but iFrames will be standard in HTML 5 when it is released with the new seamless attribute, so why would I code this page in Strict when my iFrames are supported in Transitional and it will be an easier jump to HTML 5.0 this way later down the line?
Dec 6 '10 #4
drhowarddrfine
7,435 Recognized Expert Expert
HTML 4.01 strict doesn't support iFrames
Says who? EDIT: Further clarification coming.
Normally I would use Strict and use the object tag that is meant to replace iFrames
It does not.
so why would I code this page in Strict when my iFrames are supported in Transitional and it will be an easier jump to HTML 5.0 this way later down the line?
The purpose of transitional is to allow "transitioning" of markup older than HTML 4.01 in new web documents so they won't get flagged as errors by the validator. The doctype does not prevent use of any standard HTML elements. Also, HTML5 is backwards compatible with HTML4.01 but, if anything, using transitional inhibits you from moving toward HTML5 for the fact that it only allows you to use elements that were deprecated years ago.

New web pages have NO reason to use the transitional doctype.
Dec 6 '10 #5
drhowarddrfine
7,435 Recognized Expert Expert
I tripped myself up a bit when I said iframes are supported by the strict doctype. I mis-spoke when I really meant iframes are supported in HTML 4.01. However, iframes require the frameset doctype and neither strict nor transitional should validate. HOWEVER, much to my surprise, transtitional DOES validate iframes! And I don't know why!!

Further research is needed.

EDIT: Well, by golly, I looked a the loose.dtd and iframe is in there! Why? This has sent me into a tizzy!
Dec 6 '10 #6
Elyse Summers
16 New Member
Yeah, iFrames are super quirky, it's why I was so hesitant to use them in the first place. They caused me quite a few headaches before I really got the hang of them. It is weird but the iFrame parameters are supported in both Transitional and Frameset, it's why I couldn't create this page in Strict (http://www.w3schools.com/TAGS/tag_iframe.asp). That's also where I got the "using object to replace iframe" thing, since an iframe's attributes aren't supported in HTML4.01Strict or XHTML1.0 an object can be used to simulate an iframe.
Dec 6 '10 #7
drhowarddrfine
7,435 Recognized Expert Expert
I'm trying one of my contacts. If he doesn't know, I have a few at the W3C and Opera.
Dec 6 '10 #8
Death Slaught
1,137 Top Contributor
It's definitely the CSS created from your JavaScript code that's causing the problem.

Subscribing

Regards, Death
Dec 6 '10 #9
Elyse Summers
16 New Member
Thanks so much for all the pointers guys, got it worked out - yes, it was definitely in the javascript (thanks again!), for some reason it was writing differently (or more likely, ie was reading wrong) in the standard browsers vs ie. I removed the two lines

Expand|Select|Wrap|Line Numbers
  1. "ul.flipMenu { margin-top: " + flipTopMargin + "; margin-left: " + flipLeftMargin + "; " + (flipImages ? "" : "list-style-type: none;") + " }" +
  2.     "ul.flipMenu ul, ul.flipMenu li { padding-top: " + flipVerticalPadding + "; margin-left: " + flipIndentation + "; margin_right: 0px; " + (flipImages ? "" : "list-style-type: none;") + " }" 
  3.  
and instead put their desired output straight into my css file

Expand|Select|Wrap|Line Numbers
  1. ul.flipMenu { margin-top: 5px; margin-left: -11px;  }ul.flipMenu ul, ul.flipMenu li { padding-top: 4px; margin-left: -11px; margin-right: 0px;  }li.flipFolderOpen { cursor: pointer; list-style-image: url(blank.gif); }li.flipFolderClosed { cursor: pointer; list-style-image: url(blank.gif); }
  2.  
And voila - reproduced cross-browser.

And today I have learned my lesson - even good shared free scripts should be checked carefully for browser bugs in order to avoid silly mistakes like mine :)
Dec 6 '10 #10
Death Slaught
1,137 Top Contributor
Awesome :) Could you do me a quick favor though?

Replace

Expand|Select|Wrap|Line Numbers
  1. isIE = (String(navigator.appVersion).indexOf("MSIE") > -1);
  2. if (!isIE) flipIndentation = alterSize(flipIndentation, -16);
  3. if (!isIE) flipLeftMargin = alterSize(flipLeftMargin, -16);
with

Expand|Select|Wrap|Line Numbers
  1. isIE = (String(navigator.appVersion).indexOf("MSIE") > -1);
  2. if (!isIE){ flipIndentation = alterSize(flipIndentation, -16);}
  3. if (!isIE){ flipLeftMargin = alterSize(flipLeftMargin, -16);}

and see if that fixes your original code.


Regards, Arkinder
Dec 6 '10 #11
Bryan Cheung
55 New Member
@Death, no, that should make no difference.

This is valid code:
Expand|Select|Wrap|Line Numbers
  1. if(thisIsValid)
  2.  runSomeCode(withParameters);
  3.  
And her code just puts it on 1 line, which is also valid.
Dec 6 '10 #12
Death Slaught
1,137 Top Contributor
Exactly, it shouldn't make a different. But we're dealing with IE, which seems to be ignoring those lines.

Regards, Arkinder
Dec 6 '10 #13
drhowarddrfine
7,435 Recognized Expert Expert
The only thing I've been able to find out so far about the iframe/doctype situation is that the spec writers wanted iframe to go away, so they left it out of the strict doctype. No one should be using transitional for new web pages and that would solve the issue, so they thought.

I'm trying to find more details on this.
Dec 7 '10 #14
Elyse Summers
16 New Member
Right. By my understanding, the object tag in HTML 4.01 Strict was meant to replace the functionality of the iFrame, and they would be phased out completely but... and that's where I'm at a loss, too. I can only guess that people continued to use iFrames despite this, or many complained about it, because they were added back into the standards for HTML 5 with a new "seamless" attribute to make it easier for them to appear as a natural part of the page flow.

@Arkinder I can definitely do that tomorrow when I get back into my office :). In the meantime if you don't want to wait, I have the original script before my workaround was applied saved at http://www.bradleyalanhart.com/flipmenu-original.js , feel free to grab it and test away as you please.
Dec 7 '10 #15
Death Slaught
1,137 Top Contributor
@drhowarddrfine
Since the transitional doctype was meant for those still using deprecated markup but trying to transition over. Perhaps the iframe was considered deprecated markup?

@Elyse Summers
<---------- Doesn't have IE but thanks. It's a bit of a whim but those are the lines of code being ignored. I'm glad to see that I'm not the only one who Photoshopped for Pokemon Profile Picture Month ^_^


Regards, Arkinder
Dec 7 '10 #16
drhowarddrfine
7,435 Recognized Expert Expert
@Elyse - the object element is a general purpose data container that CAN replace an iframe but was not created just for that purpose.
Dec 7 '10 #17
Elyse Summers
16 New Member
Oh, I know it wasn't created just for that, it's for embedding media, etc etc. Just meant that since they were going to be depreciating the iFrame web developers were meant to use object instead, but it didn't catch on and now the iFrame is back with extra features in HTML 5.
Dec 7 '10 #18

Sign in to post your reply or Sign up for a free account.

Similar topics

8
5620
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var...
0
1233
by: Nathan Baker | last post by:
Hi, I'm trying to port a toolbar from Firefox to IE. Right now, the part I'm working on is the toolbar's page manipulation functionality, which is all written in Javascript. Since I want to be...
15
7542
by: Giggle Girl | last post by:
Hello there, :) I need a frameset that will have the same look and behavior in Firefox 1.5+ as it does in IE 6+. Here is a URL for it: http://66.51.164.93/fs/default.htm In IE, the "seam"...
3
1955
by: Trevor2007 | last post by:
I have never been able to get the user.css file to work for me at ail, can any one help, I know how to change the web page font through the tools menue, but I would like to change the font size of...
21
1615
by: Stevo | last post by:
Look at the userAgent string: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13 It's based on a Safari so it'll suck. Time...
7
4030
by: mike57 | last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers. ...
6
4473
by: oneadvent | last post by:
This code works in Chrome and pulls a second drop down, but it will not work in IE6, (I dont have IE7/8 to check right now, but can later) and it works in FF, in IE it doesn't do anything at all. ...
1
1806
by: waqasmgl | last post by:
Hi, I m confused about following ajax code. Where is the problem? Working good on IE but not on FireFox? Please sort it out. <script type="text/javascript"> function loadXMLDoc() { if...
1
2102
by: SkyuVa | last post by:
IE8 is giving me an Unknown Runtime Error, on the following line. document.getElementById("txtHint").innerHTML=xmlhttp.responseText; Here is the complete function. function showUser(str)...
1
1929
by: jeanyl | last post by:
spotlight doesn't work in firefox and chrome... <html> <head> <title>Your title here</title> <style type="text/css"> <!-- #content{ position:absolute;top:0px;left:0px;text-align:center;
0
7260
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
7160
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
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7525
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...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.