Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to address a link inside jquery
    primarykey
    data
    text
    <p>Hy,</p> <p>i tired a long time to get this done, but it seems to that my knowledge is too limited... damn!</p> <p>I have this function now, where an image is loaded by default in the background and a accordion like menu, where one can click and than some divs fade in etc...</p> <p>In the first part i set up the default image to load and define 2 links of the accordion:</p> <pre><code>jQuery(function($) { var $img = $('&lt;img&gt;', { src: 'images/home.jpg', load: function() { $('#bg div table tr td').removeClass('loading').append(this); $(this).fadeIn('slow'); }, css: {display: 'none'} }).appendTo(document.body); $('a#the-story:not(.main-active)').live('click', function(){ $img.fadeOut('slow', function() { $('#bg div table tr td').addClass('loading'); $img.attr('src', 'images/the-story.jpg'); }); }); $('a#the-estate:not(.main-active)').live('click', function(){ $img.fadeOut('slow', function() { $('#bg div table tr td').addClass('loading'); $img.attr('src', 'images/the-estate.jpg'); }); }); }); </code></pre> <p>Now i have my accordion:</p> <pre><code>function initMenu() { $('#menu ul.sub-1').hide(); $('#menu ul.sub-2').hide(); $('a:not(.main-active)').live('click', function(){ var class = $(this).attr('id'); $('#content ul').removeClass('active').fadeOut('fast'); $('#content ul.'+class).addClass('active').delay(300).fadeIn(1000); var checkElement = $(this).next(); if((checkElement.is('ul.sub-1')) &amp;&amp; (!checkElement.is(':visible'))) { $('ul.sub-1:visible').slideUp('slow'); $(this).siblings().removeClass('main-active'); $('a.main').removeClass('main-active'); $('ul.sub-2:visible').slideUp('slow'); $('ul.sub-2:visible').siblings().removeClass('sub-active'); checkElement.slideDown('fast'); $(this).addClass('main-active'); $('a#logo').removeClass('main-active'); $('.newsletter').fadeOut(500); } if((checkElement.is('ul.sub-2')) &amp;&amp; (!checkElement.is(':visible'))) { $('ul.sub-2:visible').slideUp('slow'); $(this).siblings().removeClass('sub-active'); $('a.main').removeClass('sub-active'); checkElement.slideDown('fast'); $(this).addClass('sub-active'); } return false; } ); } </code></pre> <p>That works fine for me. Now i want to add some function, where the jQuery.address can work, because i want an URL that than opens my accordion, but i couldn´t get it to work. I tried the examples but the accordion itself there didn´t work for me at all, because jQuery.accordion doesn´t support multilevels...</p> <p>Any suggestion what i should do?</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