帝王谷资源网 Design By www.wdxyy.com
可以使用trigger方式,javascript中没有原生的trigger函数,可以自己写一个,也可以直接使用jquery的实现:
复制代码代码如下:
var button1 = document.getElementById("button1");
var button2 = document.getElementById("button2");
button1.onclick = function(){alert("button1");trigger(button2,"onclick");}
button2.onclick = function(){alert("button2");}
function trigger(ele,event)
{ele[event]();}
也可以使用更加简单的方式,就是将input覆盖住要点击的图片或者超链或者其它div,然后将input设置成完全透明,这样点击图片时其实点击的是input,如下:
复制代码代码如下:
<div class="ps-image" style="width:300px;height:300px;border:0px sold red; background:url('/images/ps.png')">
<input type="file" id="file" style="filter:alpha(opacity=0);opacity:0;width:100%;height:100%;"/>
</div>
复制代码代码如下:
var button1 = document.getElementById("button1");
var button2 = document.getElementById("button2");
button1.onclick = function(){alert("button1");trigger(button2,"onclick");}
button2.onclick = function(){alert("button2");}
function trigger(ele,event)
{ele[event]();}
也可以使用更加简单的方式,就是将input覆盖住要点击的图片或者超链或者其它div,然后将input设置成完全透明,这样点击图片时其实点击的是input,如下:
复制代码代码如下:
<div class="ps-image" style="width:300px;height:300px;border:0px sold red; background:url('/images/ps.png')">
<input type="file" id="file" style="filter:alpha(opacity=0);opacity:0;width:100%;height:100%;"/>
</div>
帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com
暂无评论...
更新日志
2024年06月17日
2024年06月17日
- 江蕙1996-台语畅销全曲珍藏版2CD[台湾][WAV整轨]
- 单依纯《想你时风起》开盘母带[低速原抓WAV+CUE]
- 群星.1990-宝丽金巨星荟萃(引进版)【宝丽金】【WAV+CUE】
- 电影原声大碟《速度与激情4》2009[WAV+CUE]
- 群星《90后经典流行歌曲精选五百首》[320K/MP3][5.4G]
- 《张宇 苦情歌 3CD》[WAV+CUE][2.2GB]
- 刀郎《2020年精选歌曲》[FLAC/分轨][305.6MB]
- 魏如萱2011-不允许哭泣的场合[亚神音乐][WAV+CUE]
- 张敬轩.2005-我的梦想我的路【几何娱乐】【WAV+CUE】
- 林一峰2003-TRAVELOGUE1游乐[香港首版][WAV+CUE]
- 刘德华《1999-2011年演唱会》[MKV][33.4G]
- 邓紫棋《2013年演唱会》[MKV][15.8G]
- 《张杰 无损音乐合集 2005-2023》[FLAC/分轨][11.8GB]
- 【休闲沙发】VA-2024-TranquilHorizons:ChilloutYourMind(FLAC)
- 【休闲沙发】VA-SeaMelodies:ChilloutYourMind(2024)[FLAC]