Qlik Community

Ask a Question

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
peachman
Contributor III
Contributor III

$(window).scroll not setting event?

Hi,

I have been trying to make an extension with a scroll event, however the event doesn't seem to bind to the window object. Below is my code. Thoughts?

 

		paint: function ($element, layout) {
			//add your rendering code here
			
            $element.empty();
            let self = this;
			var source = "'//open.spotify.com/embed?uri=" + layout.uri +"&theme=" + layout.theme + "'";
			$element.html("<iframe src=" + source + " width=100% height=100% frameborder=0 allowtransparency=true></iframe>");
			
			$( '<style>' ).html(xmas).appendTo( 'head' );
			
			$('.object-and-panel-wrapper').addClass('fadein');
			
				//$('.fadein').bind('DOMMouseScroll MouseScrollEvent MozMousePixelScroll wheel scroll', function(i){
					$(window).scroll(function(e){ //Not working
            		var bottom_of_element = $(this).offset().top + $(this).outerHeight();
            		var bottom_of_window = $(window).scrollTop() + $(window).height();
            		if( bottom_of_window > bottom_of_element ){
                		$(this).animate({'opacity':'1'},1000);
            		}         
        		});
        		
    		});
			
			var sheet = $('#grid-wrap');
			sheet.addClass('r2');
			sheet.addClass('r1');
			
			//needed for export
			return qlik.Promise.resolve();
		}	

 

 

Labels (5)
1 Solution

Accepted Solutions
peachman
Contributor III
Contributor III
Author

Problem was a compatibility with scroll event in Edge, Needs to be bind to the 'wheel' event instead.

View solution in original post

1 Reply
peachman
Contributor III
Contributor III
Author

Problem was a compatibility with scroll event in Edge, Needs to be bind to the 'wheel' event instead.

View solution in original post