【发布时间】:2014-06-30 00:01:56
【问题描述】:
我正在尝试根据是否将哈希值附加到 url unload 来定位具有唯一 href 值的通用项目类我想模拟通常在页面上发生的点击。
jQuery:
if(window.location.hash) {
var hash = window.location.hash;
function showHashVideo() {
jQuery("a.btn").attr("href", hash).trigger('click');
}
jQuery(showHashVideo);
}
HTML:
<a class="btn btn-mini" href="#help-video-modal-Graphing" data-url="video-url" data-title="Graphing">Watch Video</a>
【问题讨论】:
标签: javascript jquery hash triggers