Is it possible to set ID attribute on IFrame?

Page: 1

Author Post
Member
Registered: Mar 2018
Posts: 2
I was using old floatbox version which has the ID attribute 'fbContent' for the IFrame element. It seems that the new floatbox version doesn't have the ID attribute and instead of that it has the class name 'fbx fbContent'. Actually I have certain custom code which will invoke the IFrame element using ID. Is it possible to set ID for the IFrame using any configuration?Thank you
Administrator
Registered: Aug 2008
Posts: 3350
It was a long time ago that ids stopped being assigned to the floatbox components. The reason for the removal was the goal of using only valid html markup. When two or more floatboxes were open at the same time, duplicate ids would be assigned to their components.

It's easy to get a reference to the floatbox elements without using an id. If only one floatbox is open, a reference to the fbContent element is available as fb.fbContent. In the case of iframe content, that reference is the iframe element.

To get references to floatbox components in cases where there may be more than one box open, see the 'Multiple Floatboxes' section of the API reference.

Also note that if your code is running from within the iframe, the iframe element can reliably be accessed as window.frameElement
Member
Registered: Mar 2018
Posts: 2
Thanks very much for the details which will surely help me to continue with latest version.

Page: 1