Results 1 to 7 of 7

Thread: Image Splitter Script

  1. #1
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default Image Splitter Script

    There's no real problem, but I'm wondering if this script would be worthy to be put in the "Submit DHTML/CSS Script" section.

    It splits an image, and tilts it.
    Check this out:

    Code:
    <html>
    <head>
    <style type="text/css">
    body {
    }
    </style>
    <script>
    var source="image.png"
    var imagewidth=30
    var i=0
    onload=function() {
    for (i=0;i<=imagewidth;i++) {
    document.body.innerHTML+="<div style='position:absolute;top:"+i+"px;left:"+i+2+";width:"+i+"px;overflow:hidden'><img style='margin-left:-"+i+"' src='"+source+"'></div>"
    }
    }
    </script>
    </head>
    <body>
    </body>
    </html>
    Last edited by mburt; 08-20-2006 at 10:38 PM.
    - Mike

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Walter Zorn had the same idea, but deemed it unfeasible due to performance issues.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Thanks Twey, but mine doesn't rotate it takes a segment of an image and multiplies it by the images width
    - Mike

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well, yes, but it's the same concept.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Okay. I made a different one. It warps the image, and works flawlessly in FF and IE:

    Code:
    <html>
    <head>
    <script>
    var source="image.png"
    var i=0
    onload=function() {
    for (i=0;i<=30;i++) {
    document.body.innerHTML+="<div style='position:absolute;top:"+i+"px;left:"+i+";width:"+i+"px;overflow:hidden'><img style='margin-left:-"+i+"' src='"+source+"'></div>"
    }
    }
    </script>
    </head>
    <body>
    </body>
    </html>
    URL:

    http://www40.brinkster.com/mburt/scripts/warp_image.htm
    Last edited by mburt; 08-21-2006 at 12:16 AM.
    - Mike

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You know, it would probably be a better idea to use document.write() here...
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    The image won't appear using document.write() . I tried it
    - Mike

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
  •