PNG Transparency and Javascript Problem

Discussion in 'JavaScript' started by x2i, Jun 20, 2006.

  1. #1
    Hey, I am currently using the following code to fix the transparency problem in Internet Explorer

    <!--[if lt IE 7.]>
    <script defer type="text/javascript" 
    
    src="http://www.freewebs.com/x2i4eva/pngfix.js"></script>
    <![endif]-->
    Code (markup):
    However whenever I try to add styles or javascript - it fails to operate. For instance: <.. onClick="this.style.cssText = ''filter:xray">

    It also does this with the style tag: <.. style="border: 1px solid #000000">



    Anyone know why?
     
    x2i, Jun 20, 2006 IP
  2. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #2
    frankcow, Jun 20, 2006 IP
  3. x2i

    x2i Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    this doesnt seem to work. It just displays a smaller image without a transparent background and then a larger one with the transparency. Could you please give me an example code?
     
    x2i, Jun 20, 2006 IP
  4. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #4
    did you save the blank.gif to your image directory?
     
    frankcow, Jun 20, 2006 IP
  5. x2i

    x2i Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yep and instead it displayed the two images overlapped - one with and one without the transparency :S
     
    x2i, Jun 20, 2006 IP
  6. x2i

    x2i Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    actually i got it working now - thanx a lot for helping - much appreciated :D
     
    x2i, Jun 20, 2006 IP
  7. x2i

    x2i Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    new problem - I cant actually apply any styles or JS to the actual image, just the blank image.

    Basically I want a transparent .png then when mouse is down on it, it gains a border and then loses it on mouseup. Then when clicked it opens a new page. Also I cannot resize the png using code - again only the blank image.
     
    x2i, Jun 20, 2006 IP
  8. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #8
    I don't think you can do that. I believe the JavaScript png fix actually replaces the image with the blank image, and then applies the png as a filter

    so you may not be able to style the filtered image
     
    frankcow, Jun 20, 2006 IP
  9. x2i

    x2i Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Isnt there a way to determine at least the height and width of the filter before it is written?
     
    x2i, Jun 20, 2006 IP
  10. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #10
    Not that I'm aware of
     
    frankcow, Jun 20, 2006 IP
  11. x2i

    x2i Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    well thanx anyway - i just resorted into resizing the actual images themselves instead lol.
     
    x2i, Jun 20, 2006 IP