anchor

Adding an id to React/Gatsby component for hash link

寵の児 提交于 2021-01-28 06:29:00
问题 I have a link in a nav-bar that takes me to an anchor on the index page. Currently I don't know how to put an id onto the component, so I have to wrap the component in a div and give it an id for it to work. Ideally, I would like to simply put the anchor on the component itself. This works fine for me, but I'm wondering if this is the way to do an anchor with React/Gatsby or is there a better way? //Navbar, which is part of Layout export default class NavBar extends Component { render() {

How do I add link to another page [Django 3.0]? Reverse not found

旧城冷巷雨未停 提交于 2021-01-24 09:43:21
问题 I'm trying to add a link to blogDetails.html on the main page, but using the {% url '...' %} template tag is raising a Reverse not found exception. index.html <a href="{% url 'blogDetails' %}">O blogu</a> urls.py path('blogDetails/', views.BlogDetailsPageView.as_view(), name='blogDetails'), views.py class BlogDetailsPageView(TemplateView): template_name = 'blog/blogDetails.html' main urls.py urlpatterns = [ path('admin/', admin.site.urls), path('blog/', include('blog.urls', namespace='blog'))

Anchor download attribute created with javascript not working on iOS Chrome

好久不见. 提交于 2020-12-13 19:05:49
问题 I have a video/mp4 file saved in AWS S3 bucket, which should be downloaded from a client device (phone or computer) when the user clicks on an icon. I first make a request using fetch , and then create a blob object from the response. Next, I create an anchor element using javascript, I attach the href attribute and trigger it's click as on the code below: fetch(url, { headers: new Headers({ 'Content-Disposition': "attachment; filename='file-name.mp4'", }), }).then((response): void => { if (

Anchor download attribute created with javascript not working on iOS Chrome

狂风中的少年 提交于 2020-12-13 19:00:33
问题 I have a video/mp4 file saved in AWS S3 bucket, which should be downloaded from a client device (phone or computer) when the user clicks on an icon. I first make a request using fetch , and then create a blob object from the response. Next, I create an anchor element using javascript, I attach the href attribute and trigger it's click as on the code below: fetch(url, { headers: new Headers({ 'Content-Disposition': "attachment; filename='file-name.mp4'", }), }).then((response): void => { if (

jQuery select SVG anchor elements inside <object> tag

痴心易碎 提交于 2020-12-13 04:55:09
问题 I am having quite a bit of trouble using the anchor elements built into my SVG (displayed as an <object> ). I am trying to target the anchor elements within my Object with jQuery to toggle its respective piece of content when clicked. If you take a look at my example, I have 3 links built into my SVG (they are a lighter shade of green than the others). I used InkScape to create my SVG image, and on the light green areas that are linked are just shapes with the href attribute equal to "

REACT - How to replace URL strings to <a> elements and rendering it properly

萝らか妹 提交于 2020-12-13 04:49:08
问题 Given the following content: Hi Christine, Are you receiving? -- Daniel Vieira Costa. Frontend Developer | Zeuss, Inc. Know It's Possible. http://www.zeuss.com I want to replace all URL (e.g. http://www.zeuss.com) to <a> elements/objects and render it within a React content. My base code is the following: // regular expression used to find out all URL occorrences let regexpression = /(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([

Button for downloading SVG in JavaScript & HTML?

做~自己de王妃 提交于 2020-12-10 11:57:34
问题 There's an SVG image that's rendered in the browser. I want a button below to download the SVG. Looks like download with proper mimetype is the way to go. Attempt: <div id="container"></div> <button id="download">Download SVG</button> function downloadSVG() { const svg = document.getElementById('container').innerHTML; /*console.info(btoa(svg)); document.getElementById('svg').src = `data:image/svg+xml;utf8,${document.createTextNode(svg).textContent}`; console.info('src:', document

Border bottom on anchor tags, which works on multiple lines and with inline block / block display

偶尔善良 提交于 2020-11-29 04:32:27
问题 I have some anchor tags across my site that I need to have a 'custom' underline according to the design. The issue is that when the link text breaks to multiple lines the bottom border only applies to the bottom line / the bottom of anchor. I can solve this by giving the anchor links a display of inline, but then I lose the ability to give them a margin top. Is there any way I can give links a underline of 2px and works across multiple lines whilst also being able to give them a margin top?