Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery open div with containing li class="active"
    primarykey
    data
    text
    <p>I'm using this script for toggling/accordioning divs on my website:</p> <pre><code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://www.xyz/js/jquery.smooth-scroll.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; (function($) { $('#navigation a').smoothScroll({ easing: 'swing' }); $('.project &gt; .title').click(function(){ /* Close */ $(this).parent().siblings().children('.info').slideUp(400); $(this).parent().siblings().children('.title').removeClass('flip'); $(this).parent().siblings('.project').removeClass('open'); /* Open */ $(this).toggleClass('flip'); $(this).parent('.project').toggleClass('open'); $(this).next('.info').slideToggle(400, function(){ var project = $(this).parent('.project'); $.smoothScroll({ scrollTarget: project, easing: 'swing', speed: 400 }); }); }); })(jQuery); &lt;/script&gt; </code></pre> <p>for controlling this HTML-markup:</p> <pre><code>&lt;!-- .project --&gt; &lt;div class="project padding group"&gt; &lt;div class="title group limiter"&gt;&lt;h3&gt;START&lt;/h3&gt;&lt;/div&gt; &lt;div class="info group limiter"&gt; &lt;div class="left"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="aktuell.html" title="AKTUELL" &gt;AKTUELL&lt;/a&gt;&lt;/li&gt; &lt;li class="active"&gt;&lt;a href="jobs.html" title="JOBS" &gt;JOBS&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="presse.html" title="PRESSE" &gt;PRESSE&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="projekte.html" title="PROJEKTE" &gt;Projekte&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="archiv.html" title="ARCHIV" &gt;Archiv&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="right"&gt;123&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- .project --&gt; &lt;div class="project padding group"&gt; &lt;div class="title group limiter"&gt;&lt;h3&gt;COMPANY&lt;/h3&gt;&lt;/div&gt; &lt;div class="info group limiter"&gt; &lt;div class="left"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="1.html" title="1" &gt;1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="2.html" title="2" &gt;2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="3.html" title="3" &gt;3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="4.html" title="4" &gt;4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="5.html" title="5" &gt;5&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="right"&gt;123&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>You can see that in the first div there is an <strong>li class="active"</strong>. I want to achieve that the <strong>div class "project padding group"</strong> which contains an <strong>li class="active"</strong> is opened on page-load.</p> <p>Any suggestions on how to make this possible?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload