
layeropen({
type: 2,
content: 'test/iframehtml',
success: function(layero, index){
var iframeWin = window[layerofind('iframe')[0]['name']];
iframeWinmethod();
}
});
window[layerofind('iframe')[0]['name']];是获取子iframe的对象。
method是子iframe窗口的一个方法,名称根据实际情况替换。
ayerlayuicom/apihtml#layergetChildFrame。
layergetChildFrame(selector, index) - 获取iframe页的DOM。
当你试图在当前页获取iframe页的DOM元素时,你可以用此方法。selector即iframe页的选择器。
var iframeWin = window[layerofind('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWinmethod();不懂再继续追问吧,我尽量的给你最大的帮助
A text layer Define the size to wrap text Change anchor to set text alignment
文字图层,能定义容器的大小。更改锚点以设置文本对齐方式。
Enable 启用
A boolean that is true when the layer is displayed
勾选启用查看器中才读取这个图层。
Text 文本
A text string to display
要显示的文字。
Font Name 字体名称
The font family with which to render the text By default, uses the font on the phone, tablet, or computer the prototype is running on
用于呈现文本的字体系列。默认情况下,在使用正在运行的手机、平板电脑、电脑上的字体。
Font Size 文字尺寸
The size with which to render the text, in dp
文字大小,单位dp。
Color 颜色
The color of the layer
图层的颜色。
Position 位置
The position to display the layer Use Point 3D to set Z position
位置。使用 Point 3D 模块设置Z轴位置。
板栗:点击 Position 属性也可以显示3个轴向并设置值。
Anchor 锚点
The anchor point to position the layer relative to Determines text alignmentSee Coordinates for more information
位于屏幕中的锚点,取保字符对齐。详细信息阅读 Coordinates 坐标 。
Size 尺寸
The size of the layer Any text overflowing the width will be wrapped to subsequent lines
文本框的大小。溢出宽度的文本会自动换行。
Opacity 不透明度
The opacity of the layer
图层的不透明度。
Scale 比例
The scale of the layer
图层显示的比例。(板栗:1=100%)
Rotation 角度
The rotation of the layer Use Point 3D to set X or Y rotations
图层的角度。使用 Point 3D 模块设置Z、Y轴角度。
板栗:点击 Rotation 属性也可以显示3个轴向并设置值。
Pivot 轴心点
The pivot to rotate and scale the layer about See Coordinates for more information
图层缩放、旋转、移动时的中心点或初始点。详细信息阅读 Coordinates 坐标 。
Shadow
Shadow Color 阴影颜色
The color of the shadow
阴影的颜色。
Shadow Opacity 阴影不透明度
The opacity of the shadow By default, the opacity is 0, which disables the shadow
阴影的不透明度。 默认值为0,不显示阴影。
Shadow Radius 阴影半径
The blur radius of the shadow
阴影的模糊半径值。(板栗:值越大范围越大,颜色越淡。)
Shadow Offset 阴影偏移
The size of the shadow relative to the size of the layer
阴影相对于图层的距离和角度。
Character Spacing 字间距
A number that represents the horizontal space between characters, in dp
表示字符之间的水平间距的数字,单位dp。
Line Height 行间距
A number that represents the distance between baselines, in dp
表示两行文本间的距离,单位dp。
Paragraph Spacing 段落间距
A number that represents the vertical space between paragraphs, in dp
表示两个段落之间的距离,单位dp。
Text Size,Text Length
Text Field 文本输入框
Facebook Notifications
Create a series of notifications entirely out of loops
Fahrenheit to Celsius
Get to know logic and patches in Origami through temperature conversion
Instagram Adjust
Use drag to control the Instagram straighten tool
Instagram Color Picker
Change the text color in an Instagram Stories post
Instagram Compose
Switch between the Instagram upload options
Instagram Direct Messages
Send an Instagram direct message to a friend, over and over again
Instagram Notifications
Switch between notifications with animation
Instagram Stories Scroll
Tap to switch between read and unread Instagram Stories
Photo Zoom
Animate between two states when the screen is tapped
Traffic Light
Transition across three or more states and include logic
See Example
layer tree 分为 model layer tree(模型图层树) 、presentation layer tree(表示图层树) 、render layer tree(渲染图层树)
这三种图层树有什么作用呢?说到有啥作用,就不得不提Core Animation 核心动画了。因为这三个图层在核心动画中才能显示出它们的特点和用处。下面是官方文档的说明:
有没有感觉看了官方文档的说明还是有点点小懵逼的。那我就用我的理解再解释下。这三个图层在CALayer中可以使用的属性有两个,分别是: modelLayer (模型图层)、 presentationLayer (表现图层)。渲染图层在CALayer没有提供直接的属性给我们使用,是core Animation私有的。这里就不用说它了。
一说到"模型"大家第一反应是什么?是不是用来装数据用的,是不是会想到对象模型的概念。"模型图层" 其实就是这个作用,就是创建一个layer 然后给这个layer赋上你需要的数据。大家是不是在创建layer后,都会给生成的layer 赋值各种属性,通过这种赋值,有没感觉到这个layer本身就是modelLayer呢?那我告诉大家,必须的、必须的、必须的。重要的事情说三边。。。 layer = layermodelLayer (后面的栗子会证明这点)
"表现图层" 就是当前显示在屏幕上的图层。屏幕刷新时,就会调用presentationLayer。在core animation 动画中,可以通过这个属性,获取动画过程中每个时刻动画图层的数据,这样如果在动画过程中需要做什么处理,就可以动态的获取layer上相关的数据了。动画的过程中presentationLayer是时刻变化的,而modelLayer是不会变的。
使用basicAnimation 改变positionx的值
通过打印selfcontainerViewlayermodelLayer 和 selfcontainerViewlayerpresentationLayer的frame值对比:
第一组值:
layerpresentationLayerframe = {{ 15375329732894897 , 100}, {100, 467}}
layermodelLayerframe = {{1375, 100}, {100, 467}}
第二组值:
layerpresentationLayerframe = {{ 15470316648483276 , 100}, {100, 467}}
layermodelLayerframe = {{1375, 100}, {100, 467}}
第三组值:
layerpresentationLayerframe = {{ 17095646381378174 , 100}, {100, 467}}
layermodelLayerframe = {{1375, 100}, {100, 467}}
第四组值:
layerpresentationLayerframe = {{ 18573218822479248 , 100}, {100, 467}}
layermodelLayerframe = {{1375, 100}, {100, 467}}
第五组值:
layerpresentationLayerframe = {{ 20187994480133057 , 100}, {100, 467}}
layermodelLayerframe = {{1375, 100}, {100, 467}}
第六组值:
layerpresentationLayerframe = {{ 20441292762756348 , 100}, {100, 467}}
layermodelLayerframe = {{1375, 100}, {100, 467}}
通过六组值的观察,可以看出,动画一开始到结束,presentationLayer的frame一直在改变,而modelLayer的frame一直没变过,为什么presentationLayer的frame会发生变化呢?因为做动画的时候改变了layer的positionx值,position值的改变,会影响frame的值。
从这里我们就可以看出modelLayer 和 presentationLayer本质区别了,modelLayer 负责存储动画的目标值的模型对象。每当更改图层的属性时,它都会把数据存储下来 。当动画开始执行时,presentationLayer就上场了。屏幕上显示的就是presentationLayer,动画的过程中,你可以时刻访问动态变化的数据。例如:视频中的滚动d幕如果是使用layer做动画的,当d幕正在滚动时,你需要点击它以处理需要做的事情,这时候你就会需要presentationLayer。再结合hintTest方法来做判断:
从这个截图可以看出 selflayer = selflayemodelLayer 、 selflayer != selflayerpresentationLayer。 就是layer本身其实就是一个模型layer,只不过它拥有 presentationLayer。
CALayer是Core Animation的基础,layer tree更是Core Animation 核心动画执行过程中直接使用的对象,了解清楚layer的内在层级关系,才能更好的从细节上处理核心动画相关的事情。
在A页面加一个方法接收B页面的值,在B页面调用A页面的方法
B页面调用A页面部分代码:
var frameId = documentgetElementById("这里是layerId")getElementsByTagName("iframe")[0]id;
$('#' + frameId)[0]contentWindowfn("B页面的值");//fn是A页面声明的方法
以上就是关于如何调用layer.open打开的的iframe窗口中的JS全部的内容,包括:如何调用layer.open打开的的iframe窗口中的JS、layer调用父页面方法、1.13 Layer 图层 - Text Layer 文本图层等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)