链接在Javascript加载之前单击(问题) [英] Link Clicking Before Javascript Loads (Problem)

查看:98
本文介绍了链接在Javascript加载之前单击(问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用shadowbox进行一些html / iframe链接,这有效地打开了灯箱中的页面。一切都很好 - 除非有人在javascript完成加载之前点击。

I'm using shadowbox for some html/iframe links, which effectively opens up the page in a lightbox. Everything works great - except when someone clicks before the javascript is done loading.

现在,显而易见的答案是不使用链接作为加载shadowbox的目标。但是如果禁用javascript,这会带来可用性问题。有没有人对如何解决这个问题有任何想法?我正在考虑加载javascript内联,这会在页面加载完成之前停用链接,虽然我不确定我是如何处理的。

Now, the obvious answer is to not use links as the targets of loading the shadowbox. But this poses usability problems if javascript is disabled. Does anyone have any ideas on how else to solve the problem? I'm considering loading javascript inline that would deactivate the links until the page is done loading, although I'm not exactly sure how I'd approach that.

所有想法欢迎!

推荐答案

一般情况下,我认为这是一个非问题,但你不能只是打电话shadowbox处理器直接在链接后内联?

In general, I'd consider this to be a non-issue, but can't you just call the shadowbox processor inline directly after the links?

ie:

.link,.link,.link
script
$(。link)。shadowbox();
/ script

.link, .link, .link script $(".link").shadowbox(); /script

这篇关于链接在Javascript加载之前单击(问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆