【发布时间】:2014-06-27 15:12:45
【问题描述】:
尝试检查当前 url 是否具有 #video-value 哈希值,如果它确实运行用于同一页面上的标记链接操作的相同点击操作。
jQuery 代码:
<script type="text/javascript">
jQuery(document).ready(function () {
function showVideo() {
var $anchor = jQuery(this),
url = $anchor.data("url"),
title = $anchor.data("title");
jQuery("#help-video-iframe").css("visibility", "hidden");
jQuery("#help-video-iframe").addClass("loading");
jQuery("#help-video-iframe").load(function() {
jQuery("#help-video-iframe").css("visibility", "visible");
});
jQuery("#help-video-div-label").empty().append(title);
jQuery("#help-video-iframe").attr("src", url);
}
jQuery(function() {
jQuery("#help-videos-list a").click(showVideo);
jQuery("#help-videos-list .caption").equalizeHeights();
});
});
</script>
【问题讨论】: