My javascript executes on window load, resize and orientation change.

jQuery(window).bind("load resize orientationchange",function (e) {
//do something

This worked fine until I started using the views slideshow. My code runs before the slideshow. As it measures elements on the screen it doenst work properly. If I resize the browser (so the code re-fires) then it works as expected.

How can I make my code run after views slidehow has finished loading? I also need to re-execute the code every time a slide changes.


I faced the same issue many times (especially when I used lightbox2 module), you can use the theme_preprocess_views_view hook or one of Views template files and add the JS using drupal_add_js.

With your code

drupal_add_js('jQuery(window).bind("load resize orientationchange",function (e) {
//do something
});', 'inline');

Thanks :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.