jQuery BeautyTips and IE

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.

So I am venturing into jQuery and I like the Jeff Robbins jQuery plugin BeautyTips. Matt Farina is using it on Geeks and God. How can I get this to work in IE? I have ExplorerCanvas loading but it still won't work in IE. It works perfectly in Firefox and Webkit. I am really stumped.

bobkepford.com

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
User offline. Last seen 21 weeks 6 days ago.
The trick

Here is some example code that highlights what you need to do.

<!--[if IE]>
	<script type="text/javascript" src="/path/to/excanvas-compressed.js"></script>
<![endif]-->
<script type="text/javascript" src="/path/to/jquery.js"></script>
<script type="text/javascript" src="/path/to/jquery.bt.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    $('#example').bt();
  });
</script>

First, excanvas is conditionally loaded in IE. Then we load jQuery and Beauty Tips. Finally, we use Beauty Tips.

Does that make sense. You need this flow for dependancies. Any scripts your script depends on need to be loaded (and therefore included) before your script.

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.
Thanks, I am loading these

Thanks, I am loading these .js files in the wrong order. Thanks for confirming that for me. I will post my page when I get it working in IE.

bobkepford.com

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
User offline. Last seen 21 weeks 6 days ago.
Error In Page

If you have debugging running on the page http://statecenter.com/industrysectorshardcoded with IE you'll see an error on like 149. That section of code reads:

  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $('img.industry-icons-index').bt({
  4. titleSelector: "attr('alt')"
  5. })
  6. });
  7. </script>

The error says 'Object doesn't support this property or method'. In this I would start by putting a ; after }) on line 5. This could be causing the problem. Did that work?

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.
I fixed that error

I fixed that error but I am still getting an 'Object doesn't support this property or method' message.

bobkepford.com

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
User offline. Last seen 21 weeks 6 days ago.
Unsupported Method

The unsupported method looks to be bt on the $ object. I would start by cleaning up the theme with regard to js.

First, get rid of the js var BASE_URL. Instead use DRUPAL.settings.basePath.

Second, use drupal_add_js to add the beauty tips plugin. That will group it with the rest of them and give it some refreshing control.

Third, use drupal_add_js to add the beauty tip instancing, or put it in a scripts.js file. Instead of $ you might try using jQuery.... $ is just a reference to the jQuery object after all.

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.
I found the problem. It is a

I found the problem. It is a syntax error in IE [Expected Identifier, String or Number]. I deleted one comma at the end of the function and it is working properly.

Thanks for the help Matt, I will post a link when the section using BeautyTips is complete.

bobkepford.com

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.
Here is the completed result

Here is the completed result of my first venture into Beautytips.

http://statecenter.com/industrysectors

bobkepford.com

Simone
Simone's picture
Error!

Just to advise you that your example doesn't work in IE8

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
User offline. Last seen 21 weeks 6 days ago.
What doesn't work?

What specifically is happening and on what site?

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.
Which example isn't working

Which example isn't working in IE8. The Geeks and God or my site, http://statecenter.com/industrysectors. My site seems to be fine in IE8 on XP. It looks like the GeeksandGod.com Beautytips links to email, iTunes, and RSS are not working in IE8 on XP.

Simone, what version of Windows are you running? The problem happens on IE8 in the Windows 7 Beta on my site and GeeksandGod.com. The same issue occurs on the BeautyTips demo page. I think it's that Exporercanvas isn't working in IE8 yet. This is what the BeautyTips plugin relies on to work in IE. Here is a screenshot of the demo page Matt.
IE8 XP http://img.skitch.com/20090403-ebt678t9fms2pyj9tmc...
FF3 OS X http://img.skitch.com/20090403-ej9mw3rywhwntkhhqxu...

I'll work on this and post my progress.

bobkepford.com

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.
From the BeautyTips issue Que

From the BeautyTips issue Que on IE8 issues.
http://plugins.jquery.com/node/7109
Apparently you need this code in your head.
<meta http-equiv="X-UA-Compatible" content="IE=7" />

bobkepford.com

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.
OK, I think I have my

OK, I think I have my BeautyTips implementation working in IE8. Place
<meta http-equiv="X-UA-Compatible" content="IE=7" /> at the very top of <head> and IE8 will render your page as if it were IE7. This isn't the best solution in my opinion but it will work for the time being.

Here is a link to my implementation of BeautyTips. http://statecenter.com/industrysectors

bobkepford.com

zac
zac's picture
What am i missing?

Hi, I have been struggling with this for a while and thought I would bug you in my desperation to find a solution. Could someone please have a peek at my implementation of BT and see if it is obvious to you why I can not get this to work in IE8? Thanks for any help.. I am totally stuck at this point. The link is here:

http://olympicpeninsulawaterfalltrail.com/map

Joined: 05/20/2008
User offline. Last seen 2 years 25 weeks ago.
What exactly isn't working? I

What exactly isn't working? I don't have IE 8 handy at the moment. You can make IE 8 render as if it is ie7(see my previous post) and that fixes a lot of the issues if your site works in IE7. Need some more detail though.

bobkepford.com

zac
zac's picture
Hi, thanks for the fast

Hi, thanks for the fast reasponse :D It is coming up transparent, the bubbles with no backgrounds. I have made all the changes detailed here and at the jQuery site, I have them loading in the proper order, no bugs detected (at least by firebug).. cant think of what else it could be

zac
zac's picture
oh and it does work fine in

oh and it does work fine in IE 7 and I did put that snippet at the top of my head

Eder
Eder's picture
I have this problem too...

I have this problem too...

The debub of IE8 shows the following error:

Message: Object doesn't support this property or method
Line: 547
Char: 7
Code: 0
URI: scripts/jquery.bt.js

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
User offline. Last seen 21 weeks 6 days ago.
explorer canvas version

What version of explorer canvas are you using?

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

ie8

the IE8 problem was resolved for me after I got the latest greatest release of bt (beauty tips).
believe it is 0.95.

I was having the same problems the people of this page have described.

Hope it saves you the headache I've experienced.

Jeff

sean-james
sean-james's picture
misaligning of text/image and tip bubble

Great tooltip plug in – prettiest one I’ve seen. However, I have problems implementing it. It works without the below CSS, which is needed for the background of the website.

body {
font-family:Trebuchet MS, Helvetica, Arial, sans-serif;
font-size:75%;
line-height:1.5em;
text-align:center; /* if I remove this line, the positioning of the text/image and
bubble line up properly */
background:url(../images/page-bg-line.jpg) top left repeat-x #FFFFFF;
}

The words and images are shifted to the left or right, so it they are positioned outside the tooltip. (However, when using the complex animation tip, the words are centred).

As I’m not a CSS guru, I just wondered if someone can help me resolve this frustrating problem, which I’ve spent hours on. I’ve read some issues about absolute and relative position – is this my problem, if so how do I make the necessary changes – but I thought this was corrected with the latest version, which I am using?

The below shows what files I’m using and the js:

link rel="stylesheet" type="text/css" href="style/copy of copy of style.css">

<!-- STUFF YOU NEED FOR BEAUTYTIPS -->
<script src="BeautyTips/other_libs/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="BeautyTips/other_libs/jquery.hoverIntent.minified.js" type="text/javascript" charset="utf-8"></script>
<script src="BeautyTips/other_libs/bgiframe_2.1.1/jquery.bgiframe.min.js" type="text/javascript" charset="utf-8"></script>
<script src="BeautyTips/other_libs/excanvas_r3/excanvas.js" type="text/javascript" charset="utf-8"></script>
<script src="BeautyTips/jquery.bt.min.js" type="text/javascript" charset="utf-8"></script>
<!-- /STUFF -->

<!-- cool easing stuff for animations -->
<script src="BeautyTips/other_libs/jquery.easing.1.3.js" type="text/javascript" charset="utf-8"></script>
<!-- /easing -->


 
<script language="javascript" type="text/javascript">
$(document).ready(function() {
 
 
$('#example1').bt();

 
$('#example16').bt('<img src="images/header-gallery-botox-f.png" width="200" height="197" />',
{
  width: 200,
  fill: 'white',
  cornerRadius: 20,
  padding: 20,
  strokeWidth: 1,
  trigger: ['mouseover']
});

$('#example20').bt({
  showTip: function(box){
var $offsetParent = $("#example20");
    var $content = $('.bt-content', box).hide(); /* hide the content until after the animation */
    var $canvas = $('canvas', box).hide(); /* hide the canvas for a moment */
    var origWidth = $canvas[0].width; /* jQuery's .width() doesn't work on canvas element */
    var origHeight = $canvas[0].height;
    $(box).show(); /* show the wrapper, however elements inside (canvas, content) are now hidden */
    $canvas
      .css({width: origWidth * .5, height: origHeight * .5, left: origWidth * .25, top: origHeight * .25, opacity: .1})
      .show()
      .animate({width: origWidth, height: origHeight, left: 0, top: 0, opacity: 1}, 400, 'easeOutBounce',
        function(){$content.show()} /* show the content when animation is done */
        );
  },
  /* when using hideTip, do NOT forget 'callback' at end of animation */
  hideTip: function(box, callback){
    var $content = $('.bt-content', box).hide();
    var $canvas = $('canvas', box);
    var origWidth = $canvas[0].width;
    var origHeight = $canvas[0].height;
    $canvas
      .animate({width: origWidth * .5, height: origHeight * .5, left: origWidth * .25, top: origHeight * .25, opacity: 0}, 400, 'swing', callback); /* callback */
  },
 
  /* other options */
  shrinkToFit: true,
  hoverIntentOpts: {
    interval: 0,
    timeout: 0
  }
});

});
    </script>
</head>
Plugins.
<body>
<p> hello I am fine <span id="example1" title="The content of this tooltip is provided by the 'title' attribute of the target element.">hover</span was not you ></p>

<p> test me <span id="example16">hover</span></p>


<p> testing testing <span id="example20" title="Animations are a bit complicated, but very flexible.">hover</span>
</p>
</body>

Paulo Oliveira
Paulo Oliveira's picture
Fix to misaligning of text/image and tip bubble

Hi

I had the same problem, the problem is the centered body.

To fix this you just have to add this simple code to your css file:

div.bt-wrapper {
    text-align: left;
}

Keep in mind that the bubble code is added to the end of body element, but all elements of the div must be left aligned.

---
Best regards

tip disapearing on IE8

On IE8, my tip appears and then disapear immediately... with an error : "this[...].style is null or not an object"

I do not have this behaviour on all my pages.

Does anyone know what could cause this issue ?

Josh White
Josh White's picture
im soo stuck

First off I must say I love Geeks and God and I miss the Mustardseed podcast. I had a client fall in love with the look of the Beautytips module and I have been trying to implement it all day. I even sat in the IRC channel asking people but with no luck. Can anyone here help me? I am trying to get an image on the top right of touchplandirect.com to display an image below it when hovered. If you could help me I would reaaallly appreciate it! Keep up the great work!

Ashish Patil
Ashish Patil's picture
Regarding jquery beauty tips 0.95 version

Hey even though you are using 0.95 version of beauty tips but still in its demo page they had use

so i think you are using this statement in your code thats why its working fine at your side..

Please check and let me know..
If possible show me url where ur beauty tips pluggins is workig well..

Very good post, thanks a lot.

Very good post, thanks a lot.

Joined: 11/02/2010
User offline. Last seen 1 year 14 weeks ago.
Beauty Tip Issue regarding

I have a very little knowledge about beauty tip. So please help me out with this problem.

In my project, beauty tip and hoverIntent plugings are used. When the mouse pointer is made to hover on any of the link, a bubble tooltip gets displayed with the link's respective contents. There are hyperlinks within the bubble tooltip too. When I click anyone of those links it is opening the parent link's page.

To be more clearer.

MyLink--> If this a link on which I hover the mouse pointer, A bubble tooltip with the following content gets displayed.

This is my link. You can click YourLink too.

--> Here "YourLink" is a hyperlink. When I click this, it is opening MyLink's page but not that of YourLink's.

How do I solve this problem?

Joined: 11/02/2010
User offline. Last seen 1 year 14 weeks ago.
IE7 error

If it helps, anyone, I was recently seeing "Object does not support this property or method" in IE7, and fixed it by setting up the tips using this line:

$(":input[title]").bt();

instead of

$("[title]").bt();

Cheers :)