1. 打印iframe
eg. frameName.document.execCommand(‘print’);
2. 获取iframe
eg. var ifr_window = window.frames[“frameName”];
3. 获取iframe中的元素
eg1. 将iframe中id为elementId 的元素置为不显示:
var ifr_window = window.frames[“frameName”];
ifr_window.elementId.style.display = ‘none’;
eg2. 获取iframe中id为listTable的表格
var oTable = window.frames[“myFrame”].document.all.listTable;
4. 隐藏或显示表格的某列
js函数:
function setHiddenOrShowCol(oTable, iCol, type) {
for (i = 0; i < oTable.rows.length ; i++) {
oTable.rows[i].cells[iCol].style.display = type;
}
}
调用举例,将id为listTable的表格元素的第4列置为不显示:
var oTable = window.frames[“myFrame”].document.all.listTable;
setHiddenOrShowCol(oTable, 3, ‘none’);
调用举例2,将id为listTable的表格元素的第4列置为显示:
var oTable = document.frames.myFrame.document.all.listTable;
setHiddenOrShowCol(oTable, 3, ‘block’);
Archive for 十月, 2010
js操作iframe的一些知识
iframe用法总结
<iframe>是框架的一种形式,也比较常用到。
例子1。
<iframe width=420 height=330 frameborder=0 scrolling=auto src=URL></iframe>
不用多说了。
width插入页的宽;height插入页的高;scrolling 是否显示页面滚动条(可选的参数为 auto、yes、no,如果省略这个参数,则默认为auto);frameborder 边框大小;
(continue reading…)
HTTP_HOST
In php code: $host = isset($_SERVER[‘HTTP_X_FORWARDED_HOST’]) ? $_SERVER[‘HTTP_X_FORWARDED_HOST’] : (isset($_SERVER[‘HTTP_HOST’]) ? $_SERVER[‘HTTP_HOST’] : ”);
In javascript code: “http://” + top.location.host + top.location.pathname
flexform配置reload显示不同配置项
主要用到displayCond这个标签:
<mode>
<TCEforms>
<label>LLL:EXT:cfa_mooflow/locallang_db.xml:cfa_mooflow.pi_flexform.mode</label>
<onChange>reload</onChange>
<config>
<type>select</type>
<items type=”array”>
<numIndex index=”0″ type=”array”>
<numIndex index=”0″>LLL:EXT:cfa_mooflow/locallang_db.xml:cfa_mooflow.pi_flexform.mode.0</numIndex>
<numIndex index=”1″>MANUAL</numIndex>
</numIndex>
<numIndex index=”1″ type=”array”>
<numIndex index=”0″>LLL:EXT:cfa_mooflow/locallang_db.xml:cfa_mooflow.pi_flexform.mode.1</numIndex>
<numIndex index=”1″>DIRECTORY</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</mode>
<defaultmode>
<TCEforms>
<displayCond>FIELD:mode:=:MANUAL</displayCond>
<label>LLL:EXT:cfa_mooflow/locallang_db.xml:cfa_mooflow.pi_flexform.images</label>
<config>
<type>group</type>
<internal_type>file</internal_type>
<allowed>jpg,gif,png</allowed>
<max_size>100000</max_size>
<uploadfolder>uploads/tx_cfamooflow/</uploadfolder>
<maxitems>100</maxitems>
<size>10</size>
<selectedListStyle>Width:280px</selectedListStyle>
</config>
</TCEforms>
</defaultmode> (continue reading…)
jQuery 获取对象
# 指示 id
. 指示 class
* 全选
, 多选
空格 后代
> 子
~ 兄弟
+ 下一个
: 子(多功能)
() 函数式的过滤与查找
(continue reading…)
Imagemagick CMYK
一般场景
图片缩放
这方面的属于入门级内容,使用ImageMagick必定会用到该方面的功能。主要涉及到 -resize 参数,下面该参数效果进行展示(尺寸参数的细节请参考这里):
- -resize 100×100: 将原图缩放为100×100,同时保持比例。(结果为:75X100)
- -resize 100×100^:缩放原图,直到宽或高等于指定的缩放尺寸。(结果为:100×133)
- -resize 100×100!:缩放原图并在必要时进行拉伸,以符合指定的缩放尺寸。(结果为 100×100,但图像变形了)
- -resize 100X100>:当原图宽或高大于指定尺寸时才进行缩放,同时保持原图比例(结果为:75×100)
- -resize 100X100<:当原图宽或高小于指定尺寸时才进行缩放,同时保持原图比例(结果为:150×200,因为不满足条件) (><参数可以搭配 ^! 使用) (continue reading…)
php生成zip压缩文件
php压缩文件zip的例子
1.请先下载我准备好的zip.php工具类,下载后解压,将里面的文件放入对应的目录中,我是放在虚拟目录下的include文件夹中。
2.在你的php文件中加入下面代码即可
用法: (continue reading…)
TypoScript reference – getText
This page is document in progress. TypoScript
getText is an advanced TypoScript datatype. It enables you to access almost any data in the TYPO3 system. getText is so flexible, that it deserves it’s own page and hopefully some day this page will have enough information to be pointed to by the TSref.
It is defined in typo3/sysext/cms/tslib/class.tslib_content.php function getData.
Luckily this datatype is available everywhere, where a property has the addition stdWrap. Namely the stdWrap.data and the stdWrap.dataWrap properties. If stdWrap.insertData is set to 1, then also the property itself is parsed similar as .dataWrap is. (continue reading…)
nav_title的TS应用
level:1
Gets the current level in the rootline.
levelfield:<position>,<fieldname>[,slide]
<position> position in rootline Examples: 0: Level 0 1: Level 1 etc -1: The Level of this Page -2: One Level Up etc <fieldname> name of a field of table pages. (see notes) “ , slide” parameter forces a walk to the bottom of the rootline until there’s a “true” value to return. (continue reading…)