• But i miss a “stick/toggle on scroll” πŸ˜€
    I’m no speacialist, but i got it running with this jQuery:

    erstePosition = $('.lwptoc').offset().top;
    wurdeGestickt = '';
    $(window).scroll(function(e){ 
      var $el = $('.lwptoc'); 
      if ($(window).scrollTop() > $('.lwptoc').offset().top){ 
    	$el.css({'position': 'fixed', 'top': '70px'}); 
    	$el.width($('#main').width());
    	wurdeGestickt = 'ja';
    	if($('div').hasClass('lwptoc_items-visible')) {	
    		$('a.lwptoc_toggle_label')[0].click();
    	}
      }
      if ($(window).scrollTop() < erstePosition && wurdeGestickt == 'ja' ){ 
    	$el.css({'position': 'static', 'top': '70px'});
    	$el.width('auto');
    	wurdeGestickt = 'nein';
    	if(!$('div').hasClass('lwptoc_items-visible')) {	
    		$('a.lwptoc_toggle_label')[0].click();
    	}
      }
    });
    • This topic was modified 5 years, 5 months ago by PingZoo. Reason: pretty print ;)

The topic ‘Nearly the best’ is closed to new replies.