English 中文(简体)
与未在IEE中工作的名人的联系——已经尝试过关于SO的建议解决办法
原标题:Link to named anchor not working in IE - Have already tried suggested solutions on SO

我有一个名:子:

<table id="search_results" name="search_results">

我就是这样说的:

pagename.php#search_results

这在“E”和“Chrome”,但不是“IE”(8)。

我已尝试使用<代码><a> tag,如其他一些职位所建议的那样。 我也试图提供搜索结果表:

display: inline-block

正如一位评论者在。 我的议席也始终具有内容,该条认为,这可能是国际独立党拒绝它的原因。

I d be grateful for any suggestions.

Many thanks

问题回答

这说明我是如何寻求另一种解决办法的:

添加案文对显示不合适,非拆解空间在这两段之间造成额外直线空间。 这一点本来是可以纠正的,但是,多薪阶层的网页需要大量的手工工作。

The pages, developed with iPage, can be viewed here: www.theUB.org

I ve been told by several professionals that such long pages are usually avoided in web site design, but these pages (with many named anchors and a "point & click" Table of Contents) seem to work well for this 2000-page public domain text.

One more disadvantage of the non-breaking space solution:

这一在线文本需要由计算机屏幕阅读器正确阅读。 有些人对其他博客发表了意见,这些博客对读者表示非开拓性空间(或添加案文)。

(说明第2段之后添加的文字要点——这是防止屏幕阅读器援引合并的段落号和段落第一字的必要。)

Couple things:

IE8 does not support inline-block ;)

When you tried the a anchor, which is probably best, was your code something like

<a name="search_results"></a>
<table name="search_results" id="search_results">
</table>

The <a name=""> method is pretty much universally supported.

首先,使用名称的 anchor子浏览该页的意思。 你用一个名称anchor(<a> tag)填写。 一些浏览器支持使用非法官,但这不是普遍性的,不应像你发现的那样依赖。

Secondly, are you sure you page is long enough? If the thing you are trying to link to is right at the bottom of the page, it won t display at the top of the viewport as you might expect, since there is nothing below it to display at the bottom of the page.

第三,检查你是正确的。 你们应该这样做:

<a name="search_results"></a>
<table name="search_results">
...

Regarding named anchors that do not require text:

Others have suggested this "workaround" for IE8: insert a "non-breaking space" character if no text is required (&nbsp;).

然而,我还发现,将我E8的观点/Zoom从125%重新定位到100%,也启动了没有用“非拆卸空间”解决办法加以纠正的 anchor点。 IE8 s View/Text Size不是这一问题的一部分。

Note: Large, text only, HTML pages were being tested: (font face="Verdana" size="+1"). These HTML pages displayed correctly in Firefox 15.01 without regard to View/Zoom,Text Size settings.

I ve got this working by adding some text inside the anchor, like:

<a name="search_results">&nbsp;</a>

This appears to be another solution to the IE large file load delay: create a smaller HTML file which links via HREF to the large file (or to a bookmark (named anchor) in that file).

This test has been tried multiple times with the IE direct load of the large file always causing a long delay, but not when the user clicks the link in the small file to go to the large file.

Perhaps, IE is analyzing the primary file to see if it had already been loaded into the cache.

Note: This HTML file being tested is 11 MB (an entire book with many bookmarks and links to those bookmarks from other parts of this very long HTML page).

I faced the same problem on IE, Edge and chrome,

and I think the problem is because the encoding and decoding on the name attribute

因此,我采用了“<条码>工作解决方案>。

anchorElem.on("click",function() {
            var href = $(this).attr( href );
            var scrollEle = $(".tocContent").find( a[name="  + href.substr(1) +  "]  +  , a[name="  + decodeURIComponent(href).substr(1) +  "] );
            if (scrollEle.length > 0) {
                $( html, body ).animate({
                    scrollTop: scrollEle.offset().top
                }, 0);
                return false;
            }
        })

希望你们能帮助你们

致开幕词





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签