Overlay Red X on jpeg images?

Discussion in 'Javascript' started by Andy, Apr 7, 2004.

  1. Andy

    Andy Guest

    Is there a way to overlay a Red X on top of a .jpg image so the image still
    is visible but X'd out?

    function XitOut{
    if(document.me.Quantity.value == 0)
    {
    Put a X over the .jpg image(Okay, I know thats not JS)
    }
    }


    Andy
     
    Andy, Apr 7, 2004
    #1
    1. Advertising

  2. Andy

    Randy Webb Guest

    Andy wrote:
    > Is there a way to overlay a Red X on top of a .jpg image so the image still
    > is visible but X'd out?
    >
    > function XitOut{
    > if(document.me.Quantity.value == 0)
    > {
    > Put a X over the .jpg image(Okay, I know thats not JS)
    > }
    > }
    >


    Take the image, make a second one with the red X already on it. Then, do
    a simple image swap.

    if (document.forms['me'].elements['Quantity'].value == 0)
    {
    document.images['imageName'].src = 'imageWithX.jpg';
    }


    <img src="imageWithoutX.jpg" name="imageName">

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/
     
    Randy Webb, Apr 7, 2004
    #2
    1. Advertising

  3. Andy

    Andy Guest

    I thought about that, but I have thousands of images, I would just like to
    "X" out the image when the page loads if neccessary.
    Maybe it just can't be done.

    Andy

    "Randy Webb" <> wrote in message
    news:...
    Andy wrote:
    > Is there a way to overlay a Red X on top of a .jpg image so the image

    still
    > is visible but X'd out?
    >
    > function XitOut{
    > if(document.me.Quantity.value == 0)
    > {
    > Put a X over the .jpg image(Okay, I know thats not JS)
    > }
    > }
    >


    Take the image, make a second one with the red X already on it. Then, do
    a simple image swap.

    if (document.forms['me'].elements['Quantity'].value == 0)
    {
    document.images['imageName'].src = 'imageWithX.jpg';
    }


    <img src="imageWithoutX.jpg" name="imageName">

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/
     
    Andy, Apr 7, 2004
    #3
  4. Andy

    T. Postel Guest

    In article <3HKcc.111$>, "Andy" <> wrote:
    >Is there a way to overlay a Red X on top of a .jpg image so the image still
    >is visible but X'd out?
    >
    >function XitOut{
    >if(document.me.Quantity.value == 0)
    >{
    >Put a X over the .jpg image(Okay, I know thats not JS)
    >}
    >}
    >
    >
    >Andy
    >
    >

    I'd put a transparent .gif file (of the red X) in a layer on top of the image
    you want to X-out. You can either change the .src of the X-out image, all clear
    or X, or change the layer visibility to change state.

    --
    While my e-mail address is not munged, |
    I probably won't read anything sent there. |
     
    T. Postel, Apr 7, 2004
    #4
  5. Andy

    Ray Guest

    Here's something that'll put the X on your pics:

    http://kahaha.tripod.com/Learning/OverlayRedX/ImageSwapRedX.htm

    Your image is place in the background of a <span> tag and is
    initially covered with a transparent GIF. When your image is click'd,
    the transparent .gif is swapped with a red X .gif that has a
    transparent background. Height and width in the <img> tag should be
    changed to match your image dimensions. I'm sure the code is crude
    cause I've only been programming (HTML / CSS doesn't count) for a few
    months now. Enjoy, Ray

    On Tue, 6 Apr 2004 22:36:26 -0500, "Andy" <snip> wrote:

    >Is there a way to overlay a Red X on top of a .jpg image so the image still
    >is visible but X'd out?
    >
    >function XitOut{
    >if(document.me.Quantity.value == 0)
    >{
    >Put a X over the .jpg image(Okay, I know thats not JS)
    >}
    >}
    >
    >
    >Andy
    >
     
    Ray, Apr 8, 2004
    #5
  6. Andy

    Andy Guest

    Thanks:
    just what I'm looking for.

    Andy


    "Andy" <> wrote in message
    news:3HKcc.111$...
    Is there a way to overlay a Red X on top of a .jpg image so the image still
    is visible but X'd out?

    function XitOut{
    if(document.me.Quantity.value == 0)
    {
    Put a X over the .jpg image(Okay, I know thats not JS)
    }
    }


    Andy
     
    Andy, Apr 9, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lovaspillando
    Replies:
    0
    Views:
    1,064
    lovaspillando
    Aug 26, 2007
  2. Ivan Alameda Carballo
    Replies:
    0
    Views:
    509
    Ivan Alameda Carballo
    Aug 26, 2007
  3. EnigmaticSource
    Replies:
    4
    Views:
    854
    EnigmaticSource
    Oct 5, 2007
  4. Ken Fine
    Replies:
    4
    Views:
    454
    Steven Cheng [MSFT]
    Aug 12, 2008
  5. Alexey Smirnov

    red-X instead of dynamic images

    Alexey Smirnov, Sep 2, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    418
    Alexey Smirnov
    Sep 2, 2008
Loading...

Share This Page