I have a pure CSS accordion, it works great, but an issue is handling click shifting the screen up to the anchor tag;
<div class="collapse-content">
<div class="collapse" id="instagram">
<a class="instagram" href="#instagram" onClick="return false;"><i class="fab fa-instagram"></i>Insta</a>
<div class="content">
<div class="inner-content">
Insta content
</div>
</div>
</div>
<div class="collapse" id="twitter">
<a class="twitter" href="#twitter"><i class="fab fa-twitter"></i>Twitter</a>
<div class="content">
<div class="inner-content">
Twitter content
</div>
</div>
</div>
<div class="collapse" id="dribbble">
<a class="dribbble" href="#dribbble"><i class="fab fa-dribbble"></i>Dribble</a>
<div class="content">
<div class="inner-content">
Dribble content
</div>
</div>
</div>
</div>
How can I suppress the browser scrolling the anchor to the top of the screen? I've tried adding a ? ! and 0 to the end of the anchor, but that breaks the link from working and as you can see above I've tried onClick="return false;" which stops the click. I'm guessing what I need is some sort of offset, as I don't want to suppress the click event just the scrolling too.
# the moment I'm avoiding using Jquery, ideally no JS but trying to keep it as simple as possible.
If these aren't links, then you shouldn't be using <a> tags. Links can:
link to another document
link to another part of the same document
In this case, clicking triggers an action, you should use a <button type="button"> tag.
Related
In this codepen what's animated is a div, https://codepen.io/kevinmcullen/pen/PVmwVz?editors=1100&fbclid=IwAR0IY6EsrDj-lMs_U11ys6npbqsKd1KB5guTkMG6xCAA0GEW9_jlTwMF0Yc
<div class="wrapper">
<div class="border"></div>
<div class="main-element"></div>
</div>
</body>
in my code it looks like this
Is there even a chance of making animated border like this on a button?
https://codepen.io/paulshepherd/pen/YzqyYZw
<ul>
<li>
<button class="programming active1">Programming
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container" style="display: block;" >
I've also tried to use this code but I have a problem with converting it to css.
In this example a tag is used as a button
https://codepen.io/ARS/pen/vEwEPP
<span>button</span>
While everything is working fine in Chrome and Firefox, I am having issues in IE displaying correctly the outline focus around the content of some anchor elements.
As you can see in the picture the focus outline is outside the box, in a collapsed status (it looks like a dotted line) and not around it like in the other browsers.
That part of my HTML:
<section class='section'>
<div class='container'>
<div class='row mb-lg'>
<header class='col-md-8 col-md-offset-2 text-center'>
<h2 class='heading-with-bullet'>
Box Tests
</h2>
</header>
</div>
<div class='row'>
<div class='col-sm-4'>
<a href='/tests/test1'>
<div class='test-box'>
<div>
Test1
</div>
</div>
</a>
</div>
<div class='col-sm-4'>
<a href='/tests/test2'>
<div class='test-box'>
<div>
Test2
</div>
</div>
</a>
</div>
<div class='col-sm-4'>
<a href='/tests/test3'>
<div class='test-box'>
<div>
Test3
</div>
</div>
</a>
</div>
</div>
</div>
</section>
Any idea about on how I could have the focus outline work as expected?
I've only been able to find suggestions on how to remove the outline altogether, which is not ideal for accessibility reasons.
I as trying to make a pointing drop down, and it is as Semantic UI's documentation says it should be, but it didn't open to the side when I click,I might be missing something, can you guys help me?
<pre>
<div class="ui vertical menu">
<div class="header item">
Exemplos
</div>
<div class="ui left pointing dropdown link item">
<i class="dropdown icon"></i>
Imagem
<div class="menu">
<div class="item" routerLink="images"
RouterLinkActive="active">Reconhecimento de Objetos</div>
<div class="item">Reconhecimento Facial</div>
</div>
</div>
</div>
</pre>
The Semantic UI dropdown module requires some JavaScript for it to work properly. To just get the menu to show, you can use angular to perform the necessary Javascript work.
<div class="ui vertical menu">
<div class="header item">
Exemplos
</div>
<div class="ui left pointing dropdown link item" ngClass="{'visible': showMenu, 'active': showMenu}">
<i class="dropdown icon" (click)="showMenu = !showMenu"></i>
Imagem
<div class="menu" ngClass="{'visible': showMenu, 'hidden': !showMenu}">
<div class="item" routerLink="images"
RouterLinkActive="active">Reconhecimento de Objetos</div>
<div class="item">Reconhecimento Facial</div>
</div>
</div>
</div>
This won't apply the classes with the proper timing though to do the animations that Semantic UI provides as well. To do that you will have to load the requisite js libraries(jQuery and semantics js files) and get them to play nicely with Typescript.
I have an issue while using Joomla CMS and TinyMCE where it deletes my tags that surround which is essential for my layout.
I tried following some advice online but nothing seems to work and there's limited instructions for Joomla.
I really appreciate it and look forward to learning about this.
Code Entered
<div class="row">
<div class="col-sm-3 ">
<div>
<a href="#" class="toggle">
<div>+</div></a>
<div class="timeline-container">
<a href="#" class="another-toggle">
<div>Link</div>
<p>
Text
</p>
<a/>
</div>
</a>
</div>
</div>
</div>
Code After Saving
<div class="row">
<div class="col-sm-3 ">
<div>
<div>+</div>
<div class="timeline-container">
<div>Link</div>
<p>Text</p>
</div>
</div>
</div>
</div>
I can't say I ever found a solution to this except to stop using the TinyMCE editor. I opted to just go forward with codemirror editor where necessary.
I am using Framework7 in intel xdk. I need to add back button or link that do the slide transition in the header navbar. I add the following in the html file but the back link does not work.
<div class="navbar">
<div class="navbar-inner">
<div class="left">
<a href="#" class="link">
<i class="icon icon-back"></i>
<span>Back</span>
</a>
</div>
<div class="center">Center</div>
<div class="right">
<a href="#" class="link">
<i class="icon icon-bars"></i>
<span>Menu</span>
</a>
</div>
</div>
To do that you need class back.
Go back
You can find more information here, but I recommend you to read all documentation, not only this section.
In version 3400, just drag the button to the left corner header and when to stay "focused" (orange color) and drop! Then set the button properties.