Welcome to TalkGraphics.com
Results 1 to 10 of 10
  1. #1

    Default "animated" jpg help needed

    I have an old program that adds "moving" water to .jpg images.
    I'd like to use one on my home page if it's possible.
    The files created are either .gif or .avi.
    I tried the .gif and it works, but the size is fixed, and doesn't stretch when the browser width changes, even if made "stretchy."
    If I try to use the .avi file, it says that format isn't supported.
    Any recommendations if it's possible?
    Thanks in advance.

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,503

    Default Re: "animated" jpg help needed

    Xara used to offer these filters, snow, shimmering water, etc. but I think they discontinued support years ago.

    I would get on Google and have a look see. I'm sure you can find a bunch of these.

  3. #3

    Default Re: "animated" jpg help needed

    Hey Gary.
    I already have a program that "animates" water on a jpg.
    It outputs to .gif but xara won't make it stretchy.
    It also outputs to .avi, but xara says it can't use it when I drag it in.
    I'm trying to find out if it's possible to use on a web page.
    Last edited by Merlin_AZ; 30 January 2016 at 08:35 PM.

  4. #4
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: "animated" jpg help needed

    You can do it with a little javascript.
    In the example there is a placeholder horizontally centered on the page. It has an animated gif attached with CTRL + ALT+ SHIFT + "A". The placeholder code just contains an img element pointing to the attached gif and some javascript code. The javascript code resizes the img to the window width. It is just a quick hack taken from a 'little project' I am working on.
    Attached Files Attached Files

  5. #5

    Default Re: "animated" jpg help needed

    Quote Originally Posted by siran View Post
    You can do it with a little javascript.
    In the example there is a placeholder horizontally centered on the page. It has an animated gif attached with CTRL + ALT+ SHIFT + "A". The placeholder code just contains an img element pointing to the attached gif and some javascript code. The javascript code resizes the img to the window width. It is just a quick hack taken from a 'little project' I am working on.
    Thanks.
    I'll have a look at it tomorrow and let you know.

  6. #6

    Default Re: "animated" jpg help needed

    Nice code.
    It worked, but with an issue.
    The bottom of the image frame continues to expand downwards on top of the content lower in the page when the browser window is widened.
    Is there a way to allow it to stretch only to a certain point so it stops when it gets to that point?
    I'm using the Ultimate, single page wide template.
    I appreciate the help.

  7. #7
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: "animated" jpg help needed

    Sure, with some little changes. But in this case it is better to set the size of your animated gif directly in the placeholder code to avoid distortion...
    Attached Files Attached Files

  8. #8
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: "animated" jpg help needed

    My apologies, there is a little bug in version 2. I have forgotten to change the file name back to index_htm_files/...
    Here is a corrected example. The approach is slightly changed. You can define the minimum width and maximum height with the width and height of the placeholder. I would recommend to use the full document width as scrollbars will be added anyway if the browser window is smaller than that. The placeholder still should be horizontally centered on the page. Only the width and filename of the gif has to be entered to the code.
    Attached Files Attached Files

  9. #9
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: "animated" jpg help needed

    Just realized that this is about a simple image. You do not need to use the transform stuff in this case. Here is a simpler code:
    Code:
    <img id="stretchgif" src="index_htm_files/waves.gif" style="width:100%;height:auto;">
    <script>
    function SG_resize(){
       var width=Math.max(parseInt(window.getComputedStyle(SG_WinSizeElem).width),SG_MinWidth);
       SG_el.style.width=width+"px";
       SG_el.style.marginLeft=-Math.round(width/2)+"px";
    }
    
    var SG_WinSizeElem = document.createElement("div");
    document.body.appendChild(SG_WinSizeElem);
    SG_WinSizeElem.style.cssText="position:fixed;top:0px;left:0px;height:100%;width:100%;z-index:-99";
    
    var SG_el=document.getElementById("stretchgif").parentNode;
    var SG_MinWidth = parseInt(SG_el.style.width);
    
    SG_el.style.overflow="hidden";
    SG_el.style.left="50%";
    
    if (window.addEventListener) {
       window.addEventListener("resize", SG_resize);
    } else if (window.attachEvent) {
       window.attachEvent("onresize", SG_resize);
    }
    SG_resize();
    </script>

  10. #10

    Default Re: "animated" jpg help needed

    We're up.
    Thanks!!!
    www.stierman.net if you're interested on how it looks.
    It takes a few seconds to load, but I guess that's to be expected.

 

 

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
  •