How to set absolutePath using CSS expression for AlphaImageLoader (IE) *.png files

TIP: "Set absolutePath using CSS expression for AlphaImageLoader (IE) *.png files".
So what you can do to write absolute path in CSS files not like "HARD CODE"

Here attached below examples CSS syntax.

Before:

_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/ machine/app_resources/ui/images/wrapper.png',sizingMethod='image');

After:

_filter: expression("progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ absolutePath +"wrapper.png', sizingMethod='image')");

DESCRIPTION: The absolutePath - is javascript variable get this value "/machine/app_resources/ui/images/" and declared between HTML <head></head> block of page.
NOTE: JavaScript variable must to be declared before including CSS files see the next example.

<head>

    <title>...</title>

       <script type="text/javascript">

       var absolutePath = "/machine/app_resources/ui/images/";

       </script>

       <link href="<%=ResolveUrl("~/") %>

Read more about CSS Expression

תגים:, ,

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: