Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollspy documentation bug? -- scrollspy requires that the spied anchor be visible #13394

Closed
fczuardi opened this issue Apr 21, 2014 · 3 comments · Fixed by #13397
Closed

scrollspy documentation bug? -- scrollspy requires that the spied anchor be visible #13394

fczuardi opened this issue Apr 21, 2014 · 3 comments · Fixed by #13397
Milestone

Comments

@fczuardi
Copy link

Sometimes, if the nav items links to page anchors that are set like:

<a id="anchor-id"></a>

The code will work on firefox but not on webkit (chrome and cordova apps for example).

The reason is because scrollspy use a jQuery is.(':visible') type of check, see 5a38a57

The workaround is to set display block on your anchors, like so:

<a id="anchor-id" style="display:block;"></a>
fczuardi referenced this issue in TelaSocial/companion Apr 21, 2014
…se on webkit, so we need to make the time break anchors "visible" for the effects of scrollspy to properly work… what a difficult bug to find sigh
@cvrebert cvrebert added this to the v3.2.0 milestone Apr 21, 2014
@cvrebert
Copy link
Collaborator

Refs #11203.

@cvrebert
Copy link
Collaborator

Per http://api.jquery.com/visible-selector/

Elements are considered :visible if they consume space in the document. :visible elements have a width or height that is greater than zero.
Elements with visibility: hidden or opacity: 0 are considered :visible, since they still consume space in the layout.

@cvrebert
Copy link
Collaborator

Submitted #13397 to explicitly document this.

ithcy pushed a commit to stevelaz/bootstrap that referenced this issue Apr 30, 2014
* upstream/master: (298 commits)
  add ie-emulation-modes-warning.js to docs & examples
  Minor Spacing fixes
  Run `grunt`.
  Update holder.js to v2.3.2.
  Update JSZip to v2.2.1.
  Carousel.slide: rename e => slideEvent
  change 'slid' comments per @fat's feedback
  Document that @import-ing Bootstrap can break the icon font path
  fix twbs#13427
  add IE warning scripts to linter config
  remove semicolons :'-(
  add script to warn folks trying to test old IE using IE's unreliable emulation modes
  Document .direction & .relatedTarget properties of Carousel events. Fixes twbs#13395
  Add direction & relatedTarget properties to slid.bs.carousel event Fixes #13393
  document that show-ing a tooltip/popover on a hidden element doesn't work; fixes twbs#13362
  README: Authors => Creators
  the master branch is the relevant one for current build status
  Add missing word.
  fixes twbs#13157 - Collapse plugin - issues with transition end event bubbling
  document that non-:visible scrollspy targets are ignored; fixes twbs#13394
  ...

Conflicts:
	dist/css/bootstrap-theme.css
	dist/css/bootstrap-theme.min.css
	dist/css/bootstrap.css.map
	dist/css/bootstrap.min.css
	less/variables.less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants