Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using ajax loading for page navigation and am using delegate for the various click events required for each function etc

The problem I am having is activating a slideshow on the home page due to the way the slider is activated.

The following is what I have and obviously the load does not work as I expected it too...

$('#Content').delegate('#Home','load',function(){

swiper = new Swiper('#swiper', {
        mode:'horizontal',
        speed:900 , 
        loop:true,
    });

});

Is there a way I can get around this without implementing an if/switch statement within my navigation coding, as I would rather keep this separate.

i have also tried:

$(document/body).delegate('#Content','change',function(){....

any problems on here I have found are all related to standard problems with delegate like click events not working etc.

Thanks

share|improve this question
    
What version of jQuery are you using ? As of 1.7 .on() should be used api.jquery.com/delegate –  bart_88 Jul 19 '13 at 0:18
    
aaahhh I thought it was the other way around!!! i'm using 1.9.1. –  slappy-x Jul 19 '13 at 0:23
    
$(document).on('change', '#content', function() { ... }) –  adeneo Jul 19 '13 at 0:25
    
@adeneo Nah didn't work... –  slappy-x Jul 19 '13 at 0:27
    
I have since read that the load event wont bubble so this could be part of the problem?! –  slappy-x Jul 19 '13 at 0:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.