DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

tooltip not showing up #171

Closed Yustie closed 10 years ago

Yustie commented 10 years ago

Hi,

The tooltip doesn't show up no matter what I try. Here 2 of my many tries:

@Html.Bootstrap().TextBoxFor(x => x.Country).TypeAhead(new TypeAhead().Controller("Home").Action("GetCountries").MinLength(1)) .Id("CountryId") .Tooltip(new Tooltip("Detailed Tooltip") .Animation(true) .Delay(400) .Placement("top") .Trigger("hover click") .Container("countryGroup"))

2nd:

@Html.Bootstrap().TextBoxFor(x => x.Country).TypeAhead(new TypeAhead().Controller("Home").Action("GetCountries").MinLength(1)) .Id("CountryId") .Tooltip("testttt")

DmitryEfimenko commented 10 years ago

You need to initialize tooltip on the page load. The code to do so is in the BMVC's js file. Is it referenced on your page?

Thank You, Dmitry

On Sat, Nov 30, 2013 at 6:52 AM, Yustie notifications@github.com wrote:

Hi,

The tooltip doesn't show up no matter what I try. Here 2 of my many tries:

@Html.Bootstrap().TextBoxFor(x => x.Country).TypeAhead(new TypeAhead().Controller("Home").Action("GetCountries").MinLength(1)) .Id("CountryId") .Tooltip(new Tooltip("Detailed Tooltip") .Animation(true) .Delay(400) .Placement("top") .Trigger("hover click") .Container("countryGroup"))

2nd:

@Html.Bootstrap().TextBoxFor(x => x.Country).TypeAhead(new TypeAhead().Controller("Home").Action("GetCountries").MinLength(1)) .Id("CountryId") .Tooltip("testttt")

— Reply to this email directly or view it on GitHubhttps://github.com/DmitryEfimenko/TwitterBootstrapMvc/issues/171 .

Yustie commented 10 years ago

This file right: https://www.twitterbootstrapmvc.com/Scripts/TwitterBootstrapMvcJs-3.0.1.js ? I have it referenced yes.

DmitryEfimenko commented 10 years ago

I just tested this. It works as expected. You probably have some javascript error somewhere. Do you see any errors in console of the browser? If you do, fix them.

Thank You, Dmitry

On Sat, Nov 30, 2013 at 4:32 PM, Yustie notifications@github.com wrote:

This file right: https://www.twitterbootstrapmvc.com/Scripts/TwitterBootstrapMvcJs-3.0.1.js? I have it referenced yes.

— Reply to this email directly or view it on GitHubhttps://github.com/DmitryEfimenko/TwitterBootstrapMvc/issues/171#issuecomment-29563670 .

Yustie commented 10 years ago

After trying many things I finally got it working. I was messing around with the order of the jquery files that are being loaded.

The jqeury files where already loaded before any of the BMVC scripts where loaded. But it seems that the jquery files needs to be loaded before the twitter bootstrap scripts as well:

<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.0/jquery.validate.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>

This fixed it for me. Make sure you clear your cache too.

Side note: I got the main jquery 2.0.3 loaded in a bundle. That one gets loaded before any other script.

DmitryEfimenko commented 10 years ago

Yes, indeed. I remember this issue has bitten me once too. It's a shame I didn't think this could be an issue in your case. Glad you figured it out!

Thank You, Dmitry

On Sun, Dec 1, 2013 at 4:39 AM, Yustie notifications@github.com wrote:

After trying many things I finally got it working. I was messing around with the order of the jquery files that are being loaded.

The jqeury files where already loaded before any of the BMVC scripts where loaded. But it seems that the jquery files needs to be loaded before the twitter bootstrap scripts as well:

This fixed it for me. Make sure you clear your cache too.

Side not: I got the main jquery 2.0.3 loaded in a bundle. That one gets loaded before any other script.

— Reply to this email directly or view it on GitHubhttps://github.com/DmitryEfimenko/TwitterBootstrapMvc/issues/171#issuecomment-29572019 .

Yustie commented 10 years ago

This should be added to the docs. Its a nasty bug to fix if you don't know where to look for it.