You have arbitrary HTML Elements (IMG, A, TD, whatever). Via the CSS they are assigned an HTML Behavior
Expand|Select|Wrap|Line Numbers
- .BoldSelection {
- behavior: url(SelectBold.htc);
- border: thin solid black;
- }
So here is the HTC source. This would work if CurrentlyFocusedElementID was static between all instances of the behavior. But it isn't.
Expand|Select|Wrap|Line Numbers
- <Public:Attach Event="onContentReady" onEvent="LoadInit" />
- <Script Language="VBScript" type="Text/VBScript">
- Sub LoadInit
- element.onClick = getRef("setFocusedElement")
- End Sub
- Sub setFocusedElement
- set ele = document.getElementByID(CurrentlyFocusedElementID)
- ele.style.border = "thin solid black"
- CurrentlyFocusedElementID = element.id
- element.style.border = "thick solid black"
- End Sub
- </Script>
I would like to keep the code all contained within the HTC. I like the modular fashion of doing it this way .. that way I can simply assign the CSS Behavior and its done - no callbacks .. no parent attributes .. no HTML Components to declare.
How would you suggest I go about doing this?
Thank you in advance.