Comments (7)
Hello,
en l'état actuel des choses, la seule contrainte est que les éléments js-expandmore et js-to_expand soient adjacents, vu que j'utilise $this.next. Si c'est le cas, ça fonctionnera.
Sinon il faudrait que je trouve un système qui permette de trouver "le prochain". Note que cela doit pouvoir se faire, il suffirait de changer la méthode
$to_expand = $this.next(".js-to_expand"),
en qqch comme
$to_expand = $this.parent().find(".js-to_expand"),
et cela devrait marcher.
à+
Nico
from jquery-accessible-hide-show-aria.
Salut Nico,
Merci pour ta réponse. J'ai testé $this.parent mais ça ne fonctionne pas.
Du coup, j'ai adapté ma mise en page pour garder mon boutton dans le même conteneur puis j'ai joué avec une position absolute qui fonctionne bien grâce à ma réorganisation graphique.
Le seul point qui me gène un peu, c'est que le boutton ne sera pas au bon endroit pour les lecteurs d'écran mais je vais pas faire la fine bouche.
L'essentiel est que ça tienne la route et que tout le monde aient accès à la fonctionnalité ce que je souhaite --> cacher le chapo de l'article.
Autre chose aussi, ce serait cool de pouvoir jouer avec les animations css si possible.
Pour l'instant, j'arrive à jouer une animation au déclenchement invisible --> visible grâce à :not([aria-hidden="true"]) mais ça coince pour jouer dans l'autre sens.
Je ne pense pas que ce soit possible en pur css d'ailleurs étant donné le contexte.
Peut être ajouté les class .is-opened & .is-closed sur .js-to_expand rendrait les choses plus simple. Je n'ai pas (encore) les compétences pour intervenir sur ton code.
En tout cas merci pour tes plugins !
a+
from jquery-accessible-hide-show-aria.
Salut,
donne-moi un exemple de structure pour ton code, et je te dirais ce qui fonctionne (le $this.parent ne peut pas marcher)
Pour les animations, faudrait que je fasse qq essais, ça doit bien être possible en animant max-height ou qqch dans le genre ^^
à+
from jquery-accessible-hide-show-aria.
Salut Nico,
li.article
____.container
________figure.article_thumb
________.article-description
________.article_related
____________.article_preview-action.js-expandmore
____________.article_link
____________.article_totalcomments
____.article-preview.js-to_expend
Pour l'animation css, j'ai fait :
@Keyframes expand {
0% {
opacity: 0;
transform: scale(0);
transform-origin: right top;
}
100% {
opacity: 1;
transform: scale(1);
transform-origin: right top;
}
}
.article_preview:not([aria-hidden="true"]) {
animation: expand 300ms;
}
C'est pour le retour à [aria-hidden="true"] que ça se complique mais d'un point vue UX, ça ne me choque pas. :)
from jquery-accessible-hide-show-aria.
Du coup, ça donnerait :
$to_expand = $this.parents(".article").find(".js-to_expand"),
Je regarde pour les animations dès que j'ai un peu de temps. ;)
from jquery-accessible-hide-show-aria.
Salut Nico,
Merci pour l'info.
J'ai fait l'fou fou avec ton plugin. Mon blog ressemble à une armoire Ikéa. Il y a des tirroirs partout. :d
Si tu veux, je te montre quand c'est prêt. ;)
from jquery-accessible-hide-show-aria.
Salut,
pas de souci, je suis curieux de voir ça :)
à+
Nico
from jquery-accessible-hide-show-aria.
Related Issues (20)
- Question about browser compatibility HOT 2
- Bug on Chrome HOT 2
- Toggle to show all at once HOT 2
- Are anchored link supported? HOT 6
- Why attributes names are variables ? HOT 2
- same selector in documentation HOT 1
- Animate the icons HOT 1
- Define your own classname only once HOT 1
- rails-assets.org compatibility HOT 5
- Add type="button" to buttons
- Handle appearance and no-js without setTimeout
- "aria-controls" attribute on buttons HOT 7
- Open with anchor on the same page doesn't work (feature request)
- Why attach to element vs using button directly in HTML? HOT 1
- Toggle to show all at once *by group* HOT 2
- One button to collapse/expand them all - keyboard issue HOT 1
- Add possibility to separate styles HOT 1
- Add js- for classes used only by JS
- Add possibility to use aria attributes... or not
- Publish as npm package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-accessible-hide-show-aria.