Comments (6)
Right, my plugin should let you do that... let me do some double checking (sorry for the slower response. Been out of town).
What happened when you tried it? You aren't actually stating an issue here.
from bootstrap-hover-dropdown.
The issue is that the parent element does not link anywhere it only acts as a label (even though it has an href).
You can see an example here (try clicking "About The Tests") - http://11thstreetmedia.net/
from bootstrap-hover-dropdown.
Sorry, after looking deeper, some things came back to my memory. This is a duplicate of case #16. Bootstrap is preventing the default action for those nav items. If you want them to be clickable, you'll have to figure out a way to get around that, but it's something outside the scope of my plugin.
from bootstrap-hover-dropdown.
I'm using Bootstrap 3 now and to make the root node clickable I just returned true
instead of false
in the following bootstrap.js
Dropdown toogle function but be aware that I didn't test this extensively... :)
Dropdown.prototype.toggle = function (e) {
var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we we use a backdrop because click events don't delegate
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
}
$parent.trigger(e = $.Event('show.bs.dropdown'))
if (e.isDefaultPrevented()) return
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown')
$this.focus()
}
return true;
}
from bootstrap-hover-dropdown.
Issue #16 was the solution under Bootstrap 2. I think it still applies because I think the function you pasted in here is bound to a click event. The reason returning true in your snippet works is because returning false in a jQuery event callback stops all propagation, including the default behavior of the current event. By returning true, you allow the event to behave normally.
Just be aware on the effect this will have on mobile users (if that's even a concern of yours).
from bootstrap-hover-dropdown.
Yeah... it's working great with Bootstrap 3. I tested it on an iPhone and
the touch works as expected.
On Friday, October 11, 2013, Cameron Spear wrote:
Issue #16https://github.com/CWSpear/twitter-bootstrap-hover-dropdown/issues/16was the solution under Bootstrap 2. I think it still applies because I
think the function you pasted in here is bound to a click event. The reason
returning true in your snippet works is because returning false in a jQuery
event callback stops all propagation, including the default behavior of the
current event. By returning true, you allow the event to behave normally.Just be aware on the effect this will have on mobile users (if that's even
a concern of yours).—
Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-26189523
from bootstrap-hover-dropdown.
Related Issues (20)
- Versions do not update on CDNJS.com HOT 6
- Hover is not working in Chrome Version 47.0.2526.80 m HOT 6
- demo site down? HOT 2
- Doesn't work on Firefox 43.0.4 on Windows 10 Professional. HOT 2
- Problem when navbar is collapsed HOT 4
- Problem with hover on <a> ? HOT 3
- Deactivate hover when in "mobile mode" HOT 4
- Mouseover inputbox's remembered value will close the nav
- invalid-meta bootstrap-hover-dropdown
- Can't toggle dropdown on touch devices unless using bootstrap's data-toggle="dropdown" HOT 1
- Hover works only sometimes HOT 5
- shown.bs.dropdown & hidden.bs.dropdown are not triggered HOT 2
- When the 'a' tag has child elements the hover doesnt always work because of the event.target HOT 12
- Can't seelct the top level nav item HOT 2
- Delay option for submenus
- Anchor element gets hidden HOT 1
- Padding and margin prevents openDropdown event
- Doesn't work on Firefox 57.0.2 (64-bit) HOT 2
- My hover silently fails... HOT 3
- Any chance to implement Bootstrap 5 support?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-hover-dropdown.