adchsm / Slidebars

Slidebars is a jQuery Framework for Off-Canvas Menus and Sidebars into your website or web app.
http://www.adchsm.com/slidebars/
MIT License
1.5k stars 308 forks source link

Slidemenu closes on click #110

Closed jpadua closed 10 years ago

jpadua commented 10 years ago

Hi Adam, first I would like to say awesome work on slidebars. Its fast and is the best one I found so far.

Anyway we have been trying to figure this out for hours on our site. When we were using version 0.9.4 the menus worked ok. We updated to 0.10.1 the menu automatically closes when we click on a dropdown link inside the slidebar. By the way using your menu-style.css to add the drop downs. Any ideas of what we can try? We are using bootstrap 3, are there any other issues with bootstrap aside from modal.js? Thanks in advance!

adchsm commented 10 years ago

Hey there,

Thanks, I'm glad you like the plugin :)

Hmm that is strange, 0.10 was changed so that the plugin didn't change default link behaviour, unless you specified it too.

Which is the menu-style.css your referring too? The theme I released a while back? If so that's been discontinued as it had quite a few flaws and I didn't have the time to maintain/continue developing it.

As far as I know there doesn't seem to be any other conflicts with Bootstrap.

Do you have a demo url I can see? (If you don't want to post it publicly you can email it to me.)

Thanks, Adam

jpadua commented 10 years ago

Hi Adam, yeah its the only slider menu ive seen that performs just as smooth as a native app! Anyway i sent you the url on your email so you can check. Thanks so much.

By the way does it make a difference using jquery slideup and slidedown vs using css height and using css transitions to open a submenu?

jpadua commented 10 years ago

Hi Adam, thanks for all the help looking at the code to help me figure this out. For the benefit of the readers, make sure that sb-menu resides outside sb-site. This weird behaviour happened when we upgraded from 0.9.4 to 0.10.1 where we did not manually create sb-site to enclose the content. When we upgraded, we needed to manually add sb-site. Some closing divs were missed and sb-menu somehow got inside sb-site. Since the menu is inside sb-site no matter where you click, the default behavior would be to close the menu.

Again excellent plugin and will continue to watch it's further development of new features.

Thanks Adam!

estebandinamarca commented 9 years ago

Thanks! But, It would be possible to prevent this, by adding "sb-slidebar" inside "body" anyway?

adchsm commented 9 years ago

Hi Esteban,

I'm not entirely sure what you mean, could you elaborate?

Thanks, Adam

estebandinamarca commented 9 years ago

My slidebar implementation is working fine. The only thing (when I set by default siteClose: true) is:

When I added a link or button inside sb-slidebar, these are not working. And the only action is to close Slidebar when clicked.

I would like to add click interactions inside sb-slidebar without closing it. It is possible?

My "HTML + ASP.NET" estructure don't allows me to add sb-slidebar outside sb-site )

estebandinamarca commented 9 years ago

Don't worry. Problem resolved, I remove it from inside to outside. Thanks anyway.

adchsm commented 9 years ago

No problem, glad you got it sorted.

sirk214 commented 9 years ago

Just for the record: I recently had the same issue. No links within the slidebar react to user input (only on touch devices like smartphones or tablets). However, "long click" and "open in new tab" did work. For iPads, the tag "sb-close" solved the issue, but not on android devices. For android I had to write a javascript function which was triggered in ontouchstart (keep in mind, this event is NOT thrown on personal computers, so don't wonder while debugging ;) ) and opened new web link. However, I used your really good slidebar in another page, where everything was working fine! I have no idea yet, why i had to do this. Setup was the same...If I should find the reason, I'll comment here.

Workaround javascript ontouchstart (cannot post html here -> had to delete some "<"-tags): a ontouchstart="openLink('some_web_link')" href="some_web_link">CONTACT/a>

script type="text/javascript"> function openLink(adress){window.open(adress,"_self");} /script>

adchsm commented 9 years ago

Hi Sirk214,

Thanks for letting me know. Were you using 0.10.2?

I played with touchstart events before, but abandoned them as it was causing errors in Slidebars, activating links when you were simply scrolling down.The plugin currently accepts touchend and click events, disabling click events if a touch event was detected, as some desktop browsers do support touch events.

You can post html by putting it in three back ticks like these: ` and closing it with three more.