Donc, j'ai une liste de liens, lorsque l'on clique sur l'un div avec le contenu devrait afficher, assez facile, mais ma solution ne fonctionne pas, des idées?Vous essayez de créer un affichage/masquer le contenu à l'aide de jQuery?
Aussi je cette Bordée a commenté parce que je ne suis pas sûr que je besoin de ce depuis que je suis déjà caché et l'affichage divs en changeant leur classe css, (droit?)
// $('').toggleClass(''); --- Not sure if I need this? AND how I'd use it?..
/* Service Panel - toggle */
(function($) {
$(document).ready(function() {
$(document).ready(function() {
// $('').toggleClass(''); --- Not sure if I need this? AND how I'd use it?..
$('#family-law-item').click(function() {
$(".hide-other-desc").css({
"display": "none"
});
$(".family-law-desc").css({
"display": "block"
});
});
$('#stock').click(function() {
$(".hide-other-desc").css({
"display": "none"
});
$(".criminal-law-desc").css({
"display": "block"
});
});
$('#workshop').click(function() {
$(".hide-other-desc").css({
"display": "none"
});
$(".corporate-law-desc").css({
"display": "block"
});
});
$('#all-courses').click(function() {
$(".hide-other-desc").css({
"display": "none"
});
$(".international-law-desc").css({
"display": "block"
});
});
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<section class="services-panel">
<nav class="services-items">
<li id="family-law-item"><a href="#"> Family Law</a></li>
<li id="criminal-law-item"><a href="#"> Criminal Law</a></li>
<li id="corporate-law-item"><a href="#"> Corporate Law</a></li>
<li id="international-law-item"><a href="#"> International Law</a></li>
</nav>
<div class="service-desc-wrap">
<article id="family-law-desc hide-other-desc">
aaaaaaaaaaaaaaaaaaaaaaaaaaaaLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make
a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and
more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br>
</article>
<article id="criminal-law-desc hide-other-desc">
bbbbbbbbbbbbbbbbLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen
book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br>
</article>
<article id="corporate-law-desc hide-other-desc">
ccccccccccccccccccLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen
book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br>
</article>
<article id="international-law-desc hide-other-desc">
ddddddddddddddddddddddddddLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a
type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and
more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br>
</article>
</div>
</section>
Alors Vous aimez cette? : \t \t $ click (function() { \t \t \t $ (Toggle()); \t \t. "Règlement-desc familiale."}) ("# Famille loi article");. – Shaz
Un exemple serait étonnant – Shaz
Deux questions: 1. Est-ce que l'article est un identifiant et que l'élément link est important? 2. toggleClass() - alors pourquoi ce travail ne semble-t-il pas avoir le même schéma "cacher/afficher"? Apprendre encore :) – Shaz