Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simpel problem with qtip
12th February, 16:00
Post: #1
Simpel problem with qtip
Hi,

I am having problem to show propert HTML content i qtip. This is how I have set it up :

JS Code
$(document).ready(function () {
$.fn.qtip.styles.mystyle = { 
               width: 200,
               background: '#b7d5f4',
               color: '#212121',
               textAlign: 'center',
               border: {
                  width: 1,
                  radius: 5,
                  color: '#b7d5f4'
               },
               tip: 'bottomLeft',
               name: 'dark'
            }
 
$.each($(".tooltip"), function(i,val){
                var theContent = $(val).html();
                $(val).qtip({
                    content: theContent,
                     position: {
                              corner: {
                                 target: 'topRight',
                                 tooltip: 'bottomLeft'
                              }
                           },
                       style: 'mystyle'
                });
            });
}


The HTML looks like this :
HTML Code
<div class="controlTitleContainer">
     <div class="text"><label for="ModelViewAd_Title">Titel</label></div>
     <div class="tooltip"> 
             <div class="content">
                 <div class="icon"> </div>
                 <div class="text">Text</div>
</div></div></div>


This is how the classes is built :

tooltip : Shows a Icon and when hovering this icon the tooltip will appear
content : This is the content that is loaded into the tooltip, it is set to Style Display none so it does not show in form.
.content .icon : 21x21 with a image as background (float:left)
.content .text : Contains the test (float:left)

The problem is that the image will not show in the tooltip? what am I missing?

BestRegards
Find all posts by this user
Quote this message in a reply
13th February, 16:11
Post: #2
RE: Simpel problem with qtip
I don't see any reason why it shouldn't work. Have you used any browser developer tools to check which classes are matching the icon element?

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
15th February, 20:17 (This post was last modified: 15th February 20:19 by SnowJim.)
Post: #3
RE: Simpel problem with qtip
(13th February 16:11)Craig Wrote:  I don't see any reason why it shouldn't work. Have you used any browser developer tools to check which classes are matching the icon element?

Yes I am using FireBug. The class="content" is set to Display:none, if I change this do block then I will see the correct layout(where the icon class shows a image).

When the tooltip appear it seemse also as the icon element is placed ontop of the text instead of to the left. Changing the textAlign of the qtip to left do not fix this?

I am attaching a image that show how it looks when the content class is set to display : block

   

The reson to why the tooltip content element looks strange in this image is becourse it tries to fit it on a space of 14x15 (the small image that triggers the tooltip).
Find all posts by this user
Quote this message in a reply
16th February, 20:40
Post: #4
RE: Simpel problem with qtip
Sounds like a styling problem rather than a qTip bug... why do you have display: none; set if you don't want it hidden?

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
22nd February, 20:08
Post: #5
RE: Simpel problem with qtip
(16th February 20:40)Craig Wrote:  Sounds like a styling problem rather than a qTip bug... why do you have display: none; set if you don't want it hidden?

I have not come around to test this some more, this is how the html looks like :

HTML Code
<div class="tooltip">
     <div class="content">
                <div class="icon"> </div>
                <div class="text">Bilder som du redan laddat upp till denna annons. För att tabort uppladdad bild, tryck på krysset intill den du önskar tabort</div>
             </div>
</div>


And this is the styles:

CSS Code
.tooltip {
background-image: url("Images/Common/Icons/questionMark_15x14.png");
background-repeat: no-repeat;
cursor: help;
display: block;
float: left;
height: 100px;
margin-left: 2px;
width: 200px;
}


CSS Code
.tooltip .content {
    display: block;
}


CSS Code
.tooltip .content .icon {
    background-image: url("Images/Common/Icons/questionMark_21x21.png");
    float: left;
    height: 21px;
    width: 21px;
}


CSS Code
.tooltip .content .text {
    background-color: Blue;
    float: left;
}


And here is how it is rendered

   

Pleas note that the content class is set to display : block just to show how the tooltip supose to look like.

Do you have any idea why this does not work?
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Hiding tooltip problem sohailanwarpk 2 400 31st January 12:13
Last Post: sohailanwarpk
  qTip & ASP.NET UpdatePanel Postback Problem qTipNoob 4 3,028 10th January 15:01
Last Post: naupadnara
  [Solved] Starter problem enne87 1 627 12th July 17:29
Last Post: Craig
  Nested qtip opacity problem zensurfer 1 917 3rd May 12:49
Last Post: Craig
  qTip problem inside update panel tonofweb 2 1,115 12th April 08:26
Last Post: kiddailey
  [Solved] z-index problem RickardL 3 1,382 31st March 19:48
Last Post: kiddailey
  Viewport problem dynamicmindset 8 1,413 18th February 02:12
Last Post: Craig
  [Solved] Problem with form and postdata in qtip Baukereg 2 2,687 25th January 18:02
Last Post: b0gui
  [Solved] Newbie problem :( todsa 4 1,070 24th December 01:03
Last Post: todsa
  [Solved] qtip-1.0.0 and IE8 problem seanR 3 1,636 4th October 07:57
Last Post: seanR



User(s) browsing this thread: 1 Guest(s)