Forums
View unanswered posts | View active topics It is currently Sun Nov 23, 2014 8:29 am



Reply to topic  [ 2 posts ] 
 Using 'behavior' 
Author Message

Joined: Tue May 17, 2011 1:35 pm
Posts: 27
Post Using 'behavior'
From the documentation (and Q & A), I am led to believe that 'behavior' must be attached to each css target element that you wish to use in a PIE implemntation. Is this correct? Or does attaching it to one global element suffice? I really don't understand how 'behavior' works. Do you use behavior as a trigger to examine the target element?

Thanks in advance...

rsutton


Wed May 18, 2011 3:29 pm
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1446
Post Re: Using 'behavior'
You can read the basics of IE behaviors in Microsoft's documentation: http://msdn.microsoft.com/en-us/library ... 85%29.aspx

In a nutshell, think of the behavior property just like any other CSS property: any element that matches the selector will get that property as part of its overall set of styles. But unlike most style properties which simply modify a single aspect of the element's presentation (e.g. its background-color), the behavior style actually downloads and runs a bit of JavaScript (the .htc file) in the scope of that element.

In PIE's case, the JavaScript in PIE.htc is executed for each element to which the behavior is applied. This script examines the set of CSS3 style properties applied to the element, parses them, and creates a graphical representation of those styles using VML.

I'm not sure what you mean by "attaching it to one global element" -- it does have to be attached to each element that you want PIE to render. You can often attach it to multiple elements at once using a single selector of course.


Wed May 18, 2011 3:58 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.