Add Netscape/mozilla Compatability?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inny
    New Member
    • Nov 2007
    • 77

    Add Netscape/mozilla Compatability?

    Im using This nifty code that works Great in IE but not so great in Mozilla,
    In ie if you add an image, the sidenote fits around it, but in mozilla the image just sits over the top. please help

    preveiw



    veiw in both browsers to see the problem.

    Code:
    /*
    
    Unobtrusive Sidenotes v1.3.5 (Hosted)
    (c) Arc90, Inc.
    
    http://www.arc90.com
    http://lab.arc90.com
    
    Licensed under : Creative Commons Attribution 2.5 http://creativecommons.org/licenses/by/2.5/
    
    */
    
    /* Globals */
    var arc90_isIE = document.all? true: false;
    var arc90_sideCLRs = 4; // total colours declared in the CSS for sidenote usage
    
    /* Pre-Load */
    function arc90_preload() {
    	var head = document.getElementsByTagName('HEAD');
    
    	// add the css
    	var l = arc90_newNode('link');
    	try {
    		l.rel = "stylesheet";
    		l.type="text/css";
    		l.href="http://h1.ripway.com/Inny/clearsidenote.css";
    		// fully create the link then attach to the HEAD
    		head[0].appendChild(l);
    	} catch(e) {
    		l = null;
    	}
    }
    arc90_preload();
    
    /* Main */
    function arc90_sidenote() {
    	/* Blogger Fix: removes the crappy empty 'clear: both' div */
    	D = document.getElementsByTagName('DIV');
    	for (var j = 0, k = D.length, c = 0; j < k; j++) {
    		var d = D[j];
    		if (d.innerHTML == '' && d.style.clear == 'both') 
    			d.style.clear = 'none';
    	}
    	
    	O = document.getElementsByTagName('SPAN');
    	for (var i = 0, l = O.length, c = 0; i < l; i++) {
    		var o = O[i];
    		if (o != null && o.className && o.className.indexOf('sidenote') >= 0) {
    			try {
    				var s = arc90_newNode('div', '', 'arc90_sidenoteTXT arc90_sidenoteCLR' +c);
    				var a = arc90_newNode('div', '', 'arc90_inline');
    				a.innerHTML = arc90_gtlt(o.title);
    				s.appendChild(a);
    				o.parentNode.parentNode.insertBefore(s, o.parentNode);
    
    				o.className = 'arc90_sidenoteLNK arc90_sidenoteCLR' +c;
    				c = c + 1 < arc90_sideCLRs? c+1: 0;
    			} catch (err) {
    				o = null;
    			}
    		}
    	}
    }
    
    function arc90_gtlt(s) {
    	s = s.replace(/>/g, '>');
    	s = s.replace(/</g, '<');
    	return s;
    }
    
    /* Events */
    function arc90_isString(o) { return (typeof(o) == "string"); }
    
    function arc90_addEvent(e, meth, func, cap) {
    	if (arc90_isString(e))	e = document.getElementById(e);
    
    	if (e.addEventListener){
    		e.addEventListener(meth, func, cap);
        	return true;
    	}	else if (e.attachEvent)
    		return e.attachEvent("on"+ meth, func);
    	return false;
    }
    /* Nodes */
    function arc90_newNode(t, i, s, x, c) {
    	var node = document.createElement(t);
    	if (x != null && x != '') {
    		var n = document.createTextNode(x);
    		node.appendChild(n);
    	}
    	if (i != null && i != '')
    		node.id = i;
    	if (s != null && s != '')
    		node.className = s;
    	if (c != null && c != '')
    		node.appendChild(c);
    	return node;
    }
    
    /* Add Events */
    arc90_addEvent(window, 'load', arc90_sidenote);
    css

    Code:
    .arc90_sidenoteLNK { padding: 0 .3em; }
    .arc90_sidenoteTXT {
    	width: 12em;
    	line-height: 1.2em;
    	font-size: .8em;
    	padding: .5em;
    }
    div.arc90_sidenoteCLR0, div.arc90_sidenoteCLR2 {
    	margin: 1em 0 1em 1em;
    	float: right;
    }
    div.arc90_sidenoteCLR1, div.arc90_sidenoteCLR3 {
    	margin: 1em 1em 1em 0;
    	float: left;
    }
    .arc90_sidenoteCLR0 {
    	background-color:;
    	border: 1px solid #318484
    }
    .arc90_sidenoteCLR2 {
    	background-color:;
    	border: 1px solid #FF3535;
    }
    .arc90_sidenoteCLR1 {
    	background-color:;
    	border: 1px solid #F2D700;
    }
    .arc90_sidenoteCLR3 {
    	background-color:;
    	border: 1px solid #039B00;
    }
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    This is written by someone else. Do they claim that it works in Mozilla/Netscape?

    Comment

    • Inny
      New Member
      • Nov 2007
      • 77

      #3
      It does work in Mozzila AND IE now but ther problem is the resizer code. The resizer code kills this code in mozilla. I need to find out why So I can modify the resizer.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by Inny
        It does work in Mozzila AND IE now but ther problem is the resizer code. The resizer code kills this code in mozilla. I need to find out why So I can modify the resizer.
        So what is this resizer code?

        Comment

        • Inny
          New Member
          • Nov 2007
          • 77

          #5
          Sorry, Ignnore comment about resizer, Wrong Thread.
          Problem With This code is that Images do not remain within the 'sidenote' in mozilla.

          To see this Mozilla Issue, Please see images below marked 'IE' and 'Mozilla'

          IE screenshot


          Moz screenshot

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            The width of the sidenote is 12em and the image probably exceeds the dimensions. Maybe if you remove that, it may work.

            Comment

            • Inny
              New Member
              • Nov 2007
              • 77

              #7
              Originally posted by acoder
              The width of the sidenote is 12em and the image probably exceeds the dimensions. Maybe if you remove that, it may work.
              You havent got a bloody clue have you! Admit it! Why guess and waste my time?

              Comment

              • drhowarddrfine
                Recognized Expert Expert
                • Sep 2006
                • 7434

                #8
                The problem, as always, is IE, not Mozilla. But with an attitude like that, I'm not sure I want to tell why.

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  Originally posted by Inny
                  You havent got a bl*** clue have you! Admit it! Why guess and waste my time?
                  Wow! I'm wasting your time! No, I won't admit to that because the clue is right in front of you if you had only bothered to try.

                  The 'probably' and 'maybe' was because I hadn't tested it so couldn't guarantee that it would work. Perhaps if you are more appreciative of the free help and guidance that you're given, you might get a better response.

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32656

                    #10
                    Originally posted by Inny
                    You havent got a bloody clue have you! Admit it! Why guess and waste my time?
                    Stupidity is sort of excusable - but why broadcast it? I'd want to keep that sort of knowledge to myself.

                    Comment

                    • Dasty
                      Recognized Expert New Member
                      • Nov 2007
                      • 101

                      #11
                      Originally posted by Inny
                      You havent got a bloody clue have you! Admit it! Why guess and waste my time?
                      The sad part is, that acoder is actually right. Your arc90_sidenoteT XT class has fixed width of 12em which causes your overflow. :(

                      Comment

                      • Inny
                        New Member
                        • Nov 2007
                        • 77

                        #12
                        So a thread here is only intresting enough for every tom dick and harry to pipeup if somebody loses it?
                        Where were all you loud mouths all this time ?
                        I tried removed the 12em width but it didnt work!
                        the frustration stems from the vagueness of replies which dont help (free or otherwise) somebody who is new to js.
                        If you want to help, try giving an example, dont assume the person asking will automatically know exactly what you mean and exactly how to fix it. Thats arrogance, were not all code einsteins!

                        My comment came from another thread here where I was screwed around with guesses and repeated questions about errors when acoder simply didnt know.
                        you couldve said "sorry, its got me stumped", but no, you just went on and on telling stuff that didnt work, being vague and evasive, and wasted my time.

                        a more helpful person on another site had it sussed and showed me how to fix it
                        straight off.

                        If you dont know ,you dont know, thats ok, but dontr pretent and further frustrate folk.

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32656

                          #13
                          I'm sure that's all very funny (and I'll leave it here for everyone to see) but I'm afraid that as you were warned specifically about this particular breaking of the rules (Unacceptable Behaviour) I have banned your account.
                          It is a temporary ban as that's what the rules indicate. Any repetition of this of course, will lead to a permanent ban.

                          Comment

                          • NeoPa
                            Recognized Expert Moderator MVP
                            • Oct 2006
                            • 32656

                            #14
                            For anyone who is specifically insulted within this post, please don't concern yourself. I would be very surprised if anyone out there is actually stupid enough not to realise that to be insulted by someone with these views is no criticism at all.
                            Keeping the post visible, shows we do not use our powers to censor criticism (besides it's worth a laugh).

                            Comment

                            • acoder
                              Recognized Expert MVP
                              • Nov 2006
                              • 16032

                              #15
                              To clear things up a bit...
                              Originally posted by Inny
                              So a thread here is only intresting enough for every tom dick and harry to pipeup if somebody loses it?
                              Of course.
                              Originally posted by Inny
                              I tried removed the 12em width but it didnt work!
                              It should work and testing shows that it does. The fact that it didn't means that something else is causing it not to work.
                              Originally posted by Inny
                              the frustration stems from the vagueness of replies which dont help (free or otherwise) somebody who is new to js.
                              If you want to help, try giving an example, dont assume the person asking will automatically know exactly what you mean and exactly how to fix it. Thats arrogance, were not all code einsteins!
                              It's not arrogance. It's an assumption that you will understand what is being said. If you don't, all you have to do is ask and we will provide an example or a better explanation.
                              Originally posted by Inny
                              My comment came from another thread here where I was screwed around with guesses and repeated questions about errors when acoder simply didnt know.
                              you couldve said "sorry, its got me stumped", but no, you just went on and on telling stuff that didnt work, being vague and evasive, and wasted my time.
                              It wasn't guesswork. It was simply to eliminate other possibilities. You didn't give the full information. If you make one change, it could cause new errors in your code. I wasn't stumped. I might've solved it in the end if you had the patience.
                              Last edited by acoder; Dec 21 '07, 10:12 AM. Reason: .

                              Comment

                              Working...