Skip to content

Fix carousel and other Bootstrap JS plugins broken by jQuery noConfli… - #171

Merged
seisman merged 1 commit into
masterfrom
fix/website-146-carousel-jquery-noconflict
Aug 27, 2026
Merged

Fix carousel and other Bootstrap JS plugins broken by jQuery noConfli…#171
seisman merged 1 commit into
masterfrom
fix/website-146-carousel-jquery-noconflict

Conversation

@Esteban82

Copy link
Copy Markdown
Member

The theme's bundled jquery-fix.js calls jQuery.noConflict(true) before bootstrap.min.js loads, wiping window.jQuery and breaking every Bootstrap JS plugin (carousel, dropdowns, ...).

This overrides that file (Sphinx lets project static files shadow theme static files) to use noConflict() instead, which keeps window.jQuery defined for bootstrap.min.js while leaving bootstrap-sphinx.js's behavior unchanged.

Verified locally with sphinx-build: no more console error, and the carousel auto-advances and responds to manual prev/next/indicator clicks.

Fixes #146

Done with Sonnet 5

…ct order

The sphinx_bootstrap_theme package loads scripts as: jquery,
jquery-fix.js, bootstrap.min.js, bootstrap-sphinx.js. Its bundled
jquery-fix.js calls jQuery.noConflict(true), which strips both
window.jQuery and window.$ before bootstrap.min.js loads.
bootstrap.min.js grabs the global jQuery symbol to attach its
plugins, so it throws immediately and none of them (carousel,
dropdown, collapse, ...) ever get attached.

Override the theme's static jquery-fix.js (Sphinx lets project
html_static_path files overwrite theme static files of the same
name) to call noConflict() without removing window.jQuery, which
keeps bootstrap.min.js working while bootstrap-sphinx.js still uses
window.$jqTheme as before.

Fixes #146
@Esteban82
Esteban82 requested review from a team and seisman August 26, 2026 16:37

@seisman seisman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that it works.

@seisman
seisman merged commit ca99937 into master Aug 27, 2026
2 checks passed
@seisman
seisman deleted the fix/website-146-carousel-jquery-noconflict branch August 27, 2026 06:10
@yvonnefroehlich

Copy link
Copy Markdown
Member

Nice! Thanks for looking in this quite old issue 🙂.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possibly not working "slide show" on GMT website

3 participants