Results 1 to 5 of 5

Thread: boxing in with doctype does't go in firefox

  1. #1
    Join Date
    Jun 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default boxing in with doctype does't go in firefox

    1) Script Title: Boxing in

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex3/document7.htm

    3) Describe problem: I would like to present my website with !Doctype ...
    but Safari + Firefox does not show.

    see:
    http://www.alice-dsl.net/roterhusar/indexa.html
    http://www.alice-dsl.net/roterhusar/indexb.html

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    This is an extremely old script, and I wouldn't recommend you use it before I get the chance to rewrite it. It has problems displaying in IE7 as well.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't know anything much about Safari. This upgrade will work out for FF, Opera and IE and probably many others, hopefully including Safari:

    Code:
    <script type="text/javascript">
    
    /*
    Boxing In Script-© Dynamic Drive (www.dynamicdrive.com)
    For source code, installation instructions, 100's DHTML scripts, and TOS,
    visit http://www.dynamicdrive.com
    */
    
    //change speed here
    var speed=5
    
    ///////////////////// Stop Editing /////////////////////
    
    function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
    }
    
    var ns4=document.layers?1:0
    var ie4=document.all?1:0
    var ns6=document.getElementById&&!document.all?1:0
    
    if (ns4){
    var reference=window.innerWidth/window.innerHeight
    var temp=eval("document.i1.clip")
    temp.left=temp.top=0
    temp.right=window.innerWidth
    temp.bottom=window.innerHeight
    }
    else if (ie4||ns6){
    var reference=window.innerWidth?parseInt(window.innerWidth)/window.innerHeight: iecompattest().clientWidth/iecompattest().clientHeight
    var rightclip,leftclip,topclip,bottomclip
    var temp=ns6?document.getElementById("i1").style:document.all.i1.style
    topclip=leftclip=0
    rightclip=window.innerWidth?window.innerWidth*0.98:iecompattest().clientWidth
    bottomclip=window.innerWidth?window.innerHeight-2:iecompattest().clientHeight
    temp.width=rightclip+'px'
    temp.height=bottomclip+'px'
    }
    
    
    function doit(){
    window.scrollTo(0,0)
    if (ns4){
    if (temp.left>window.innerWidth/2)
    clearInterval(stopit)
    temp.left+=reference*speed
    temp.top+=speed
    temp.right-=reference*speed
    temp.bottom-=speed
    }
    else if (ie4||ns6){
    halfofbrowser=window.innerWidth?parseInt(window.innerWidth/2):iecompattest().clientWidth/2
    if (leftclip>halfofbrowser){
    clearInterval(stopit)
    temp.display="none"
    }
    temp.clip="rect( "+topclip+"px "+rightclip+"px "+bottomclip+"px "+leftclip+"px)"
    leftclip+=reference*speed
    topclip+=speed
    rightclip-=reference*speed
    bottomclip-=speed
    }
    }
    stopit=setInterval("doit()",100)
    
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jun 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face

    tested with
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    and
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    in Safari, FF, Opera, Omniweb, Flock, Camino, heavy Mozilla, Seamonkey, Shira, all work fine
    only icab kritizizes:
    CSS-Fehler (13/23): Ungültige CSS Eigenschaft "layer-background-color"

    Thank you very much jscheuer1 and dd for this imploding effext.

    good night!
    Gerd

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not too many browsers will like:

    layer-background-color

    as it is NN4 and earlier only. However, this alone shouldn't break the script in any browser. It is only a style, even though it is considered (and is) invalid in any modern browser, they should simply ignore it. It does show up in both Opera's and FF's error console (as being ignored), but these aren't normally seen, as they are reserved for troubleshooting.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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