gehuangyi20 / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 0 forks source link

[Feature implementing] Repeating transparent background png #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Its just a way of feature implementing, not a bug.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
2.0(beta 3)

Please provide any additional information below.

>>Unfortunately, the transparent background image cannot be tiled 
(repeated) using background-repeat. Nor can it be positioned using 
background-position.

That my idea for repeating support (sure it's not in right place, but done 
in short time):

  // replace background(-image): url(..) ..  with background(-
image): .. ;filter: ..;
  IE7.CSS.addFix(/background(-image)?\s*:\s*([^};]*)?url\(([^\)]+)\)
([^;}]*)?/, function(match, $1, $2, url, $4) {
    url = getString(url);

    // Hack for bg repeating support
    var repeatExp = new RegExp('repeat-[xy]','i');
    var scalingMethod = 'image'; // or crop
    var overflow = '';
    if (repeatExp.test($4)) {
        var scalingMethod = 'scale';
        overflow = 'overflow:hidden;';
    }

    return PNG.test(url) ? overflow + "filter:" + format(PNG_FILTER, url, 
scalingMethod) +
      ";zoom:1;background" + ($1||"") + ":" + ($2||"") + "none" + 
($4||"") : match;
  });

Original issue reported on code.google.com by Segr...@gmail.com on 30 Oct 2008 at 5:33

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
http://www.codingforums.com/showthread.php?p=774792#post774792

Trying to get the above example working. IF the snippet author gets this, can 
you 
please help. Thanks. 

Original comment by ce...@cesarvillaca.com on 27 Jan 2009 at 6:33

GoogleCodeExporter commented 9 years ago
Hi, try to use the attached js file, not sure that is last version for today 
but it from a live project.
If it doesn't help then please provide with more details about your issue.

Original comment by Segr...@gmail.com on 28 Jan 2009 at 10:31

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks much for the quick responce. I replaced your code with mine and I now 
get the 
alert() trigger at line 1761. What does this mean?

Original comment by ce...@cesarvillaca.com on 28 Jan 2009 at 12:53

GoogleCodeExporter commented 9 years ago
My sorry, just remove the line: alert('addFilter');

Original comment by Segr...@gmail.com on 6 Apr 2009 at 8:47

GoogleCodeExporter commented 9 years ago
The default behaviour is for backgrounds to repeat. So it is unlikely that the 
CSS will 
contain the repeat flags.

I've implemented it the other way round. If "no-repeat" is present then the 
sizing 
method is "crop" otherwise it is "scale".

This will be in version 2.1.

Original comment by dean.edw...@gmail.com on 10 Feb 2010 at 10:12

GoogleCodeExporter commented 9 years ago
The Twinhelix iepngfix script now has support for tiling background images in
iepngfix_tilebg.js. Can that method be added to IE7.js?

Original comment by nickandr...@gmail.com on 14 Mar 2010 at 10:41

GoogleCodeExporter commented 9 years ago
@nickandroid You can still use alternative PNG solutions. IE7.js will not alter 
the DOM 
to achieve its results so I cannot use the twinhelix approach.

Original comment by dean.edw...@gmail.com on 15 Mar 2010 at 12:10

GoogleCodeExporter commented 9 years ago
@nickandroid checkout http://www.dillerdesign.com/experiment/DD_belatedPNG/ it 
works perfect with ie7-js. 
here is a test-page: http://flashjunior.ch/school/test/ietest/

Original comment by goo...@flashjunior.ch on 15 Mar 2010 at 4:18