thanks, thad helped me too!:)

On Monday, 10 December 2012 06:35:43 UTC+1, jerrytouille wrote:
>
> Hi Ben,
>
> Thanks for the reply! I also figured it out a few days ago by doing:
>
> if ($('.btn').is(":visible")) $('.btn').click();
>
> This works a bit better when resizing the window in the latest version of 
> bootstrap when hide/show the menu button.
>
> - Son
>
>
> On Mon, Dec 10, 2012 at 11:18 AM, Ben Rubinger 
> <[email protected]<javascript:>
> > wrote:
>
>> Hi there Son,****
>>
>> ** **
>>
>> I have one event handler for when any button in the navbar is clicked. I 
>> have a check in there:****
>>
>>         if ($('#NavInnerComponent').hasClass('in')) {****
>>
>>             $("#NavDisplayButton").click();****
>>
>>         }****
>>
>> I hope that helps…****
>>
>> ** **
>>
>> -Ben****
>>
>> ** **
>>
>> *From:* [email protected] <javascript:> [mailto:
>> [email protected] <javascript:>] *On Behalf Of *Son Phan
>> *Sent:* Thursday, December 6, 2012 10:56 AM
>> *To:* [email protected] <javascript:>
>> *Subject:* Re: auto hide on link click? (.nav-collapse)****
>>
>> ** **
>>
>> hi ben can you post the code sample? I'm stuck on this issue for hours 
>> already and couldn't get it. thanks!!
>>
>> On Friday, October 5, 2012 9:44:06 AM UTC+7, benrhere wrote:****
>>
>> If anyone’s interested, I got this working. In the javascript that is 
>> triggered in the nav button, I check to see if the “in” class is present in 
>> the relevant div (with .nav-collapse). If ‘yes’, then I do a “click” on the 
>> button that will retract the nav.****
>>
>>  ****
>>
>> *From:* [email protected] [mailto:[email protected]] 
>> *On Behalf Of *benrhere
>> *Sent:* Thursday, October 4, 2012 7:30 PM
>> *To:* [email protected]; [email protected]
>> *Subject:* auto hide on link click? (.nav-collapse)****
>>
>>  ****
>>
>> Hi there,****
>>
>>  ****
>>
>> I've got a responsive navbar, just like you see on the bootstrap homepage:
>> ****
>>
>>  ****
>>
>> http://twitter.github.com/bootstrap/****
>>
>>
>> When the window is too narrow, instead of displaying the links up top, it 
>> gives a single button in the upper right corner, which drops down the nav 
>> menu. I've got this working exactly like it does on the bootstrap site.**
>> **
>>
>>  ****
>>
>> But... on the bootstrap site you click and navigate to a new page, which 
>> causes the nav to reset. (You can see that until the browser navigates 
>> away, the menu stays collapsed.) My links don't go to new pages but execute 
>> javascript, so the nav never collapses after any nav item is clicked. How 
>> can I get the nav to collapse after an item is clicked?****
>>
>>  ****
>>
>> Thanks...****
>>
>>  ****
>>
>> -Ben****
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"twitter-bootstrap" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to