anchor

create URL with anchor to text selection

空扰寡人 提交于 2021-02-07 08:26:53
问题 I would like to create a URL pointing to a web service I write, http://mycoolthing.com , together with an #-anchor that refers to a text selection on that page. Is is possible in HTML/JS to create an anchor that refers to a Selection or a RangeObject? 回答1: chromium based browsers now support Scroll To Text Fragment https://chromestatus.com/feature/4733392803332096#:~:text=This%20feature%20allows%20a%20user,and%20scrolls%20it%20into%20view. 回答2: As I mentioned in a comment, here is an option

create URL with anchor to text selection

人走茶凉 提交于 2021-02-07 08:25:13
问题 I would like to create a URL pointing to a web service I write, http://mycoolthing.com , together with an #-anchor that refers to a text selection on that page. Is is possible in HTML/JS to create an anchor that refers to a Selection or a RangeObject? 回答1: chromium based browsers now support Scroll To Text Fragment https://chromestatus.com/feature/4733392803332096#:~:text=This%20feature%20allows%20a%20user,and%20scrolls%20it%20into%20view. 回答2: As I mentioned in a comment, here is an option

create URL with anchor to text selection

孤者浪人 提交于 2021-02-07 08:25:03
问题 I would like to create a URL pointing to a web service I write, http://mycoolthing.com , together with an #-anchor that refers to a text selection on that page. Is is possible in HTML/JS to create an anchor that refers to a Selection or a RangeObject? 回答1: chromium based browsers now support Scroll To Text Fragment https://chromestatus.com/feature/4733392803332096#:~:text=This%20feature%20allows%20a%20user,and%20scrolls%20it%20into%20view. 回答2: As I mentioned in a comment, here is an option

How can I set the browser tab's anchor target name via javascript?

若如初见. 提交于 2021-02-07 08:12:35
问题 When my website is called from an external hyperlink it shall be re-opened within the same browser tab, if it is already open. This can be achieved by specifying an appropriate target attribute within the hyperlink's HTML: <a href='http://my-website.org' target='my_target' /> However, this does not work, if the first tab is opened without a target being specified, e. g. by directly typing in the website's url. After this the hyperlink using my_target will pull up a second browser tab. So, I

Javascript Find The Colour Of Link

瘦欲@ 提交于 2021-02-05 09:24:15
问题 So the issue I'm having basically comes down, I have a list of external websites in HTML (as seen below). <a id="listitem0" href="http://google.com.au/">http://google.com.au/</a><br /> <a id="listitem1" href="http://stackoverflow.com/">http://stackoverflow.com/</a><br /> <a id="listitem2" href="http://kbbdigital.com.au/">http://kbbdigital.com.au/</a><br /> <a id="listitem3" href="http://netreach.com.au/">http://netreach.com.au/</a><br /> And some of them I have visited & others I haven't, so

Anchors with fixed navigation and sticky header

拟墨画扇 提交于 2021-02-04 21:39:08
问题 As you can see in this jsfiddle , I have a navbar and a sticky header per div. Now if i click on my anchors I get scrolled down to the right position, but the header overlaps the text of the div. I want the header to be positioned above the div when scrolling down, this can be accomplished by setting .header { margin-bottom: 40px; } If I do that I get an offset, which I don't want at all, as you can see here: Margin bottom Is there any way to accomplish avoiding the overlapping and having no

Anchors with fixed navigation and sticky header

半城伤御伤魂 提交于 2021-02-04 21:36:54
问题 As you can see in this jsfiddle , I have a navbar and a sticky header per div. Now if i click on my anchors I get scrolled down to the right position, but the header overlaps the text of the div. I want the header to be positioned above the div when scrolling down, this can be accomplished by setting .header { margin-bottom: 40px; } If I do that I get an offset, which I don't want at all, as you can see here: Margin bottom Is there any way to accomplish avoiding the overlapping and having no

Anchors with fixed navigation and sticky header

巧了我就是萌 提交于 2021-02-04 21:36:06
问题 As you can see in this jsfiddle , I have a navbar and a sticky header per div. Now if i click on my anchors I get scrolled down to the right position, but the header overlaps the text of the div. I want the header to be positioned above the div when scrolling down, this can be accomplished by setting .header { margin-bottom: 40px; } If I do that I get an offset, which I don't want at all, as you can see here: Margin bottom Is there any way to accomplish avoiding the overlapping and having no

Remove anchor from url - add string to url - and append anchor at the end again

笑着哭i 提交于 2021-01-29 10:50:39
问题 I'm searching for a jquery solution that converts the following URL: http://www.mysite.com/longpage.html#title3 into http://www.mysite.com/longpage.html?var=1#title3 Simply adding the "?var=1" is no problem. But the anchor only works when it's placed at the end of the URL. 回答1: From what you're describing in your question, a simple replace will do the trick: "http://www.mysite.com/longpage.html#title3".replace(/(#.+?)$/, '?var=1$1') It's just plain JS because that's all that's needed. 回答2:

How do I navigate to hidden anchors?

ε祈祈猫儿з 提交于 2021-01-28 20:01:04
问题 I have a hidden element on my page with id select-box : <select style="display:none;" id="select-box"> There's a <label> at the top of my page: <label for="select-box">Select box</label> Because the <select> is hidden, clicking on the <label> has no effect. Is there a way to achieve this, preferably without using any JavaScript? 回答1: The css feature display:none; removes the element from the document. try: style="visibility:hidden; width:0px" visibility:hidden keeps the element in the dom and