Support » Plugin: Accordion Blocks » Add resize event

  • Resolved Hrohh

    (@hrohh)


    Hello, can you please trigger resize event after slideUp / slideDown in JS?
    Thank you

    
    function triggerResize() {
    	if (typeof(Event) === 'function') {
    	  // modern browsers
    	  window.dispatchEvent(new Event('resize'));
    	} else {
    	  // for IE and other old browsers
    	  // causes deprecation warning on modern browsers
    	  var evt = window.document.createEvent('UIEvents');
    	  evt.initUIEvent('resize', true, false, window, 0);
    	  window.dispatchEvent(evt);
    	}
    }	
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Phil Buchanan

    (@philbuchanan)

    I’ve added a feature request. I’m not sure when I’ll be able to address it though.

    Thread Starter Hrohh

    (@hrohh)

    Hello, ok thanks. I just edited your code and it works ok

    
    item.content.slideUp(duration, function() {
        triggerResize();
        setCloseItemAttributes();
    });
    
    item.content.clearQueue().stop().slideDown(duration, function() {
        triggerResize();
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add resize event’ is closed to new replies.